Closed (fixed)
Project:
Entity API
Version:
7.x-1.x-dev
Component:
Entity CRUD controller
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Sep 2013 at 01:00 UTC
Updated:
19 Jul 2017 at 11:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ferrari commentedPatch to fix this.
Comment #2
cosolom commentedDuplicate? https://drupal.org/node/1780646
Comment #3
amitaibuNo, not duplicate of #1780646: entity_access() fails to check node type specific create access
The
access()method of the wrapper accepts only 'view' or 'edit'. However, if the node isn't saved yet, we should check for 'create' inentity_metadata_no_hook_node_access()Comment #4
joshk commentedThis is required to make use of the wonderful Restful module; any idea what needs to happen for it to be added?
Comment #5
e0ipsoThis is working properly.
Comment #6
fagoIf the wrapper calls the function wrong, it should be fixed in the wrapper instead. It's not the job of this callback to take care of wrong API usage.
Comment #7
amitaibuI will try to run RESTful tests with this one
Comment #11
amitaibuIt seems that tests are currently failing due to testbot issues:
Comment #16
roysegall commentedComment #18
roysegall commentedI'm pushing another commit. This one worked on my local machine.
Comment #19
roysegall commentedComment #20
ckngInitial test shows patch #18 is working.
Comment #21
roysegall commented@fago can you please review?
Comment #22
amitaibuThis is working for a few month now on RESTful's simpletests.
Comment #23
e0ipsoIs there anything I can do to help move this forward?
Comment #24
lukewertzI've tested this patch as well and it works great. +1 for merging in the next available release! Thanks!!
Comment #25
Anonymous (not verified) commentedI have also reviewed & tested this with success.
Comment #26
tripper54 commentedTested with success, +1 to get this committed!
Comment #27
fagoSry for letting this lie so long. Parts of the patch confuse me though:
Why/when would there be no vid when it's the update case? It seems invalid for an update case to have a node without a vid, isn't it? Previously the code here only covered create, why is that changed?
Comment #28
amitaibu> Sry for letting this lie so long
No worries, I'm doing worth on my issue queues ;)
if (empty($node->vid)I think (haven't tested) that it's related to comment about
// This is a new node or the original node. We'll check it..Comment #29
omarlopesinoPatch #18 works!
I could be need something like this to prevent massive warnings in restful, when I create nodes in POST mode, because for ensure user property access, entity access is called indirectly in 'edit' mode, even when the node is not created yet.
However, I'm agree with @fago, the entity contrib module shouldn't prevent the warnings if there is a bad usage of entity API.
There is something I don't entirely understand, in which real case should be checked entity access in update mode, on a entity which doesn't exists yet? Should not be used 'create' access in that case?
Comment #30
David Hernández commentedSeems that this patch was already applied but this issue was not updated. Can anyone else confirm this?
Comment #31
anthonys commentedYes, looks like this has been applied.
Comment #32
alvar0hurtad0+1 the patch is applied on 1.8
Comment #33
alvar0hurtad0Is included on the commit of this issue:
#1989444: Views integration for properties of type = duration does not work.
Comment #34
aron novak