Needs work
Project:
Entity API
Version:
7.x-1.x-dev
Component:
Entity property wrapper
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Nov 2010 at 08:59 UTC
Updated:
29 Jan 2019 at 18:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fagoindeed, that one is required. Fixed the docs to mention that.
Comment #2
joachim commentedI think this is a little clearer.
Comment #4
fagothanks, committed.
You'll need to use
git diff --no-prefixfor creating patches for d.o.Comment #6
acrazyanimal commentedI believe there is also an inconsistency at play here in the implementation of the propertyAccess function in entity.wrapper.inc. At least with respect to how the other Entity API's access functions such as entityAccess and entity_access work. Those functions return NULL if an 'Access Callback' has not been set. This makes sense because then the caller can decide if NULL should be treated TRUE or FALSE in terms of granting access. However, propertyAccess assumes FALSE if its call to entityAccess returns NULL where it should probably just forward the result onward.
This affects rules access checking for certain entity related actions and in my case is preventing me from being able to use a VBO operation based on a rules component that uses the 'set data value' on an entity that does not specify an 'access callback'. I'm referencing the issue I've opened for rules here as well: #1526198: Default to TRUE if entity_access returns 'NULL'
Here is a patch to set it straight.
Comment #7
acrazyanimal commentedComment #8
mgiffordPatch applies nicely. The logic's pretty simple. Ran it through Coder and there were no problems reported on the patch that was contributed.
Comment #9
fagoDefaulting to NULL for propertAccess() if no entity access is defined makes sense to me. We should document it though why we are passing through $access + state this at docs of the access() method.
Comment #10
acrazyanimal commentedI would be happy to update the documentation when this get committed.
Comment #11
mgifford@fago so that patch needs to be rebuilt to change the defaults for propertAccess().
Comment #12
acrazyanimal commented@fago: Originally I thought you meant add to the documentation of the module, but looking back at your comment in #9 I realize you probably meant document the propertyAccess() function to explain in-line why we would pass $access through. So I have gone ahead and rebased against the latest dev and added some description to the function.
Does this work for you?
Comment #13
chris matthews commentedThe 6 year old patch in #12 to entity.wrapper.inc does not apply to the latest entity 7.x-1.x-dev.
Comment #14
daiwik.addweb commented@Chris Matthews, Here's the patch for the same, kindly share your feedback after using it. Thanks!.