- Issue created by @jurgenhaas
- 🇩🇪Germany jurgenhaas Gottmadingen
This has also been discussed at https://drupal.slack.com/archives/C0287U62CSG/p1708437647447219:
James Shields 23 hours ago Something that would be really amazing would be the ability to build configurable components in ECA, and then be able to use them in further ECA models. For example, I'm working on a number of models that email different groups of users. It would be amazing if I could build a component in ECA that called a view, and emailed the users selected. It would need to allow tokens to be passed in for the view, or possibly the contextual filter, and the message contents, but once built that could be used across multiple models. 4 replies jurgenhaas 23 hours ago Yep, we've done that. Not for emails, but for log message handling. The idea is still the same, though. You can build your generic "Send email model" that contains a custom event. All your other models trigger that custom event with all the necessary arguments (=tokens), and then your generic model does all the magic about sending emails. James Shields 23 hours ago Oh, that could work. I'm already triggering a custom event to send my emails. It didn't occur to me that the custom event handler doesn't have to be in the same model. James Shields 23 hours ago Can you use a token to select the name of the view a model calls? jurgenhaas 23 hours ago Aah, that's a good point. No, we currently can't since that config field is a select field (drop-down). But we're currently working on an issue where the language selector could do with token support as well and we're doing it there with a select list option called "Use token", and then the plugin uses a pre-defined token name for that. We should probably add something similar to all config fields that come with drop-downs.
-
jurgenhaas →
committed 0bfbb9db on 2.0.x
Issue #3422936 by jurgenhaas, lostcarpark: Add "Use token" option to...
-
jurgenhaas →
committed 0bfbb9db on 2.0.x
- 🇩🇪Germany jurgenhaas Gottmadingen
We've now implemented a generic method to support tokens in drop down fields over at ✨ Allow tokens in "Entity: create new" for langcode Needs work with language codes.
This is now adopted to the views query action plugin as well and can be tested in the 2.0.x-dev release.
- 🇩🇪Germany jurgenhaas Gottmadingen
There are 36 plugins altogether that we can improve with this new feature:
web/modules/contrib/eca/modules/access/src/Plugin/Action - SetAccessResult.php web/modules/contrib/eca/modules/base/src/Plugin/Action - SetEcaLogLevel.php - Translate.php web/modules/contrib/eca/modules/base/src/Plugin/ECA/Condition - ListContains.php web/modules/contrib/eca/modules/cache/src/Plugin/Action - CacheActionBase.php web/modules/contrib/eca/modules/content/src/Plugin/Action - FieldUpdateActionBase.php - NewEntity.php web/modules/contrib/eca/modules/content/src/Plugin/ECA/Condition - EntityFieldIsAccessible.php - EntityIsAccessible.php - EntityTypeAndBundle.php web/modules/contrib/eca/modules/content/src/Service - EntityLoader.php web/modules/contrib/eca/modules/endpoint/src/Plugin/Action - SetAjaxResponseMessageCommand.php - SetAjaxResponseOpenOffCanvasDialogCommand.php web/modules/contrib/eca/modules/file/src/Plugin/Action - FileRename.php web/modules/contrib/eca/modules/form/src/Plugin/Action - FormAddFieldActionBase.php - FormAddSubmitButton.php - FormSetMethod.php web/modules/contrib/eca/modules/log/src/Plugin/Action - LogMessage.php web/modules/contrib/eca/modules/miscellaneous/src/Plugin - RouteTrait.php web/modules/contrib/eca/modules/queue/src/Plugin/Action - EnqueueTaskDelayed.php web/modules/contrib/eca/modules/render/src/Plugin/Action - Cacheability.php - GetFileContents.php - Link.php - RenderElementActionBase.php - Serialize.php - Text.php - Unserialize.php - Views.php web/modules/contrib/eca/modules/ui/src/Form - Settings.php web/modules/contrib/eca/modules/user/src/Plugin/ECA/Condition - CurrentUserPermission.php - CurrentUserRole.php web/modules/contrib/eca/modules/views/src/Plugin/Action - ViewsQuery.php web/modules/contrib/eca/modules/workflow/src/Plugin/Action - WorkflowTransition.php web/modules/contrib/eca/src/Plugin/Action - ListAddBase.php - ListRemoveBase.php web/modules/contrib/eca/src/Plugin/ECA/Condition - StringComparisonBase.php
-
jurgenhaas →
committed fbb430b3 on 2.0.x
Issue #3422936 by jurgenhaas, lostcarpark: Add "Use token" option to...
-
jurgenhaas →
committed fbb430b3 on 2.0.x
-
jurgenhaas →
committed 887f5422 on 2.0.x
Issue #3422936 by jurgenhaas, lostcarpark: Add "Use token" option to...
-
jurgenhaas →
committed 887f5422 on 2.0.x
- Status changed to Fixed
7 months ago 2:36pm 15 May 2024 - 🇩🇪Germany jurgenhaas Gottmadingen
All drop-down config fields in ECA now support tokens. See also the CR at https://www.drupal.org/node/3447358 → which is relevant for module maintainers who probably want to update their plugins accordingly.
- 🇮🇪Ireland lostcarpark
Brilliant! I will have to try out the 2.x branch soon.
Thanks for this feature.
Automatically closed - issue fixed for 2 weeks with no activity.