- Issue created by @coaston
- π©πͺGermany jurgenhaas Gottmadingen
This is currently not yet possible. However, it has been raised in a different context recently, and we may well add something in the future. It's important to recognize the difference that events for are being dispatched in the backend, so that ECA can subscribe to them and take some action. What this issue is all about, are events that occur in the frontend. So, what may be an extension to ECA at some point is a framework that allows to recognize frontend-events and dispatch a backend event from them. This will then also require a framework to allow the backend to trigger some actions in the frontend as a response to such events. Maybe the already existing ajax commands are sufficient for that.
Not really related, but since you also raised that question, the "Event-based selection with ECA" is an event that gets dispatched during auto-complete activity, where an entity reference field in the frontend requests a list of matching entities from the backend. With that event, ECA can hook into that process and alter the result.
- πΈπ°Slovakia coaston
Thank you for your answer. I hope one day there will be such feature available as it seems i am not the only one who would love to use sort of "dependent field".
- π©πͺGermany jurgenhaas Gottmadingen
Progress so far is that we're getting ready for ECA 2.0 next week, so that new features will be going into the 2.1 branch. That's what today's update of this issue was about.
When we will get into implementing new features depends on a lot of things, e.g. how important is it to how many users, is there any funding, do we have resources who are willing to work on this on their own time, etc.
- Status changed to Postponed: needs info
about 1 month ago 5:28pm 28 January 2025 - π©πͺGermany jurgenhaas Gottmadingen
The eca_endpoint sub-module now has all the ajax commands implemented that Drupal core provides. With those, almost all interaction between frontend and backend should be possible. See the action plugins at https://ecaguide.org/plugins/eca/endpoint/
Please give that a try if it allows you to do what you're looking for.
- πΈπ°Slovakia coaston
Hi jurgenhaas,
Sorry, I somehow didn't notice that you had replied until just now.
I wanted to try, but not sure what I am doing wrong. I have used following example : Endpoint Test and i have updated Route Match to
"entity.node.edit_form"
so now when I navigate to article node/x/edit I can see message like "You are visiting "[mynode:title]" so it works for my edit form, however as you suggested there should be ajax available now, so I wanted to select TAG and display the current value, however it does not work until I save the article.In other words when I navigate node/x/edit and i would like to see message like "You are visiting "[mynode:title] and [mynode:field_tags]" but I can see message ""You are visiting "[mynode:title] and ..." which is fine because there is no any TAG added yet. Now I add tag with value 1 for example, but message still display "You are visiting "[mynode:title] and ..." and i need to save the node to see expected valu ["You are visiting "[mynode:title] and [mynode:field_tags]" so I cannot work dynamically with that value and possible update dependent field and ajax is not working in this case, or am I missing anything ?
- π©πͺGermany jurgenhaas Gottmadingen
This is a closed issue. If you want to follow-up on this, you need to create a new one. And there you need to described step by step what you're doing so that we can reproduce it. From the comment #11 nobody can tell what ECA model you've created and how there is any ajax in the game.
- πΈπ°Slovakia coaston
Thank you.
Information for others who are facing the same problem as I am and want to replicate the 'dependent field': Here is the exact model that performs this function Eca dependent-field β , and we can finally remove the rules module and use only ECA.
Here you can find my video Eca Dependent. β
Note: who needs to use Taxonomy instead of select list, just use Options instead of "11:11: anything like "[tid]:[name] so "671:Admin change"
@jurgenhaas I believe this example can be added to eca library because i believe many users will find is useful and this feature prevented to get rid of rules as described here. β
- π©πͺGermany jurgenhaas Gottmadingen
Thank you @coaston for sharing this, I'm totally impressed. This is amazing!!!
We will certainly add this to the ECA Guide. In the meantime, I've shared this in the #ECA channel of Drupal Slack for all the others to know about it too. I wanted to mention you in that post but you don't seem to be on Drupal Slack?
- π©πͺGermany jurgenhaas Gottmadingen
Hey @coaston, one more question: what version of ECA have you been using when exporting this model? I'm asking because the node type config file contains properties that make it difficult to import the model on existing sites. and that issue has been fixed back in June last year. So, your ECA version appears to be older than that?
- πΈπ°Slovakia coaston
You're right. In my local environment, I have about 10 different test sites, and this particular one is quite old, using an older Drupal 9 or 10 version. But if needed, I can recreate it, as it's very easy to set up.
I'm also impressed because I've been missing this feature for almost two years, and I have sites in production that couldn't be migrated from Drupal 9 to 10 because there's no stable release of the Business Rules module. So now we can finally migrate to Drupal 10.