- Issue created by @ergonlogic
- 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
ergonlogic → changed the visibility of the branch 3432502-extend-existing-plugins to hidden.
- 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
ergonlogic → changed the visibility of the branch 3432502-extend-plugins to hidden.
- Assigned to ergonlogic
- 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
The 2.0.x branch has drifted too far from 1.1.x for me to be able to develop my extension against it without significant refactoring. I need my plugin to work against the current stable release, so I'm going to start a new branch forked from 1.1.x.
- Merge request !411Draft: Resolve #3432502 "Simplify extending existing plugins." → (Open) created by ergonlogic
- 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
As a starting point, branch
3432502-1.1.x-extend-existing-plugins
now allows extension ofeca_access
plugins using the technique described above.I've also attached a patch to make it simpler to incorporate into a `composer.json` file.
- 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
Re-rolled the patch, since it included the fix from 🐛 ECA Access: Incorrect field name in "Determining entity field access" plugin Needs work
- 🇩🇪Germany jurgenhaas Gottmadingen
I like this improvement, but we can only make use of it if it gets developed against 2.0.x from where it could then be backported, once completed.
- Issue was unassigned.
- Status changed to Needs work
about 1 year ago 10:14pm 21 March 2024 - 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
Right. ECA is becoming a key piece of our Drupal stack, so I'm sure that I'll have a chance (hopefully over the summer) to refactor this against 2.0.x.
Some notes on possible future improvements to this:
- Abstract the underlying implementation to pass the class name as a parameter
- Move that method into a trait (or base class) for easier re-use across the rest of ECA (it currently only applies to
eca_access
) - Add some static caching to minimize performance impact.
- Add some docs to show how easy it has become to extend existing plugins.
- 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
Also worth noting here: we could not get our extended access plugin to interact properly with the upstream one.
For background, the idea was to use the field access plugin (from
eca_access
) to forbid access to all fields, then use our plugin (that extends the field access one) to allow access during some workflow steps (in combination with other conditions).While we could accomplish something similar (minus the workflow bit) with just the upstream plugin, we needed to use our extended one for both parts (forbid then allow), in order for this to work.
We think this might have something to do with the order that the
hook_entity_field_access()
are being evaluated or how the SymfonyEventDispatcher
sorted events. But we haven't yet been able to determine the root cause of this. - 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
Is this still on your radar @ergonlogic?
Not at the moment, no.
- Status changed to Closed: won't fix
4 months ago 11:48am 8 December 2024 - 🇩🇪Germany jurgenhaas Gottmadingen
Closing for now. Feel free to re-open when needed.