This originated as a spin-off of #1831578: Use file_entity_access() callback when file_entity module is present.
The patch there fails with the version of File Entity bundled with Media 1.3 (which is still the default version), because the file_entity_access function was introduced in File Entity 2.0.
Also, the explicit dependency on File Entity module seems inelegant.
The normal way of resolving an issue like this would be for the dependent module (in this case File Entity) to run after Entity API and insert its own callback - but we already put ourselves at the bottom of the list.
Patch to follow makes this more generic, allowing any module to insert its own access callback. Could be extended to the other callbacks, but I'll leave that for now since there are no issues around it.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2094833-entity-access-alternatives-2.patch | 3.51 KB | checker |
#5 | 2094833-entity-access-alternatives-2.patch | 3.58 KB | checker |
#1 | 2094833-entity-access-alternatives.patch | 1.19 KB | wodenx |
Comments
Comment #1
wodenx CreditAttribution: wodenx commentedComment #2
wodenx CreditAttribution: wodenx commentedComment #3
joachim CreditAttribution: joachim commentedThe comment would make a bit more sense to me if it said something like:
// Core entity types do not have our access callbacks. They are provided here, unless another contrib module has already done so. This must be done here since ... [as before]
But that's personal preference, so I'll leave that up to the patch author and maintainer.
Other than that, looks good :)
Comment #4
checker CreditAttribution: checker commentedPatch #1 looks good. But I think it should be usable for all core entities. So comment and taxonomy_term are missing. This patch is lightweight and generically enough.
I'm confused about this hard coded patch for file entity module #1831578: Use file_entity_access() callback when file_entity module is present.
Comment #5
checker CreditAttribution: checker commentedPatch #1 + commet, taxonomy_vocabulary, taxonomy_term
Comment #7
checker CreditAttribution: checker commentedComment #8
checker CreditAttribution: checker commentedComment #10
checker CreditAttribution: checker commented#2269989: Entity module brute forces it's entity_info_alter() values. is a better solution.
Comment #11
checker CreditAttribution: checker commented