- Issue created by @jeffgtr
- π©πͺGermany jurgenhaas Gottmadingen
Maybe there is a configuration issue in the ECA model? I'm asking because we do use such transition events successfully, so I doubt this is a bug. If you could provide a simplified ECA model which reproduces the "error", we can have a look what's wrong.
Sure. Here is a link to screenshots of the configuration. The workflow states are created by the Entity Registration module.
- π©πͺGermany jurgenhaas Gottmadingen
Did you know you can export a model and then upload the exported archive here? That's much better than screenshots.
Anyways, in this case it looks like the condition is somehow not really an empty condition. You may want to delete that link between event and action and then add a new one without ever selecting a template for that condition.
And last but not least, there is a section Debugging in the ECA Guide which will show you where the processing actually stops. It could be the event, which doesn't match the transition, or that condition which is my assumption here, or some permission check anywhere in the model.
Thank you for your quick reply, it's very much appreciated. So I started over and created a new model and turned on debugging in the log. The model I created that sends an email when a basic page is created shows up in the log. The process for the workflow state change never shows in the log. I'm uploading the exported model. I'm wondering if this could be an issue with the Entity Registration module however it is using the core Workflow and everything is working on that end.
- π©πͺGermany jurgenhaas Gottmadingen
Unfortunately, that model does not come with all its dependencies. Have you disabled dependency calculation in ECA settings?
The process for the workflow state change never shows in the log.
Well, if the event is not showing up there, it won't be dispatched, and it is necessary to find out why that's the case. Maybe a special implementation by the entity registration module?
- π©πͺGermany jurgenhaas Gottmadingen
What could also be the case, that you're hit by the core bug at π Wrong revision can be loaded into original in \Drupal\Core\Entity\EntityStorageBase::doPreSave Needs work which prevents Drupal to recognize a workflow state change. You may want to apply the patch from MR3599 and see if that makes any difference.
This appears to be isolated to the Entity Registration module. I submitted this as a bug with them and they responded they are going to try and get it working this week. Just in case anyone else is struggling with this issue.
- π©πͺGermany jurgenhaas Gottmadingen
Thanks a lot @jeffgtr for following up on this one. Hope, it gets resolved in Entity Registration. If any adjustment was needed at our end, we're happy to help.
Letting you know that there is a fix for the Entity Registration module. The fix is in the dev version I have tested and everything works fine.
- π©πͺGermany mxh Offenburg
Linking to related issue. ATM I'm not sure whether that is or was the right approach. Workflow transitions should be recognized by ECA, without any special integration. Unless there is special behavior, of course.
- π©πͺGermany jurgenhaas Gottmadingen
Workflow transitions should be recognized by ECA, without any special integration.
Yes, for sure. But that other module doesn't seem to be doing a workflow transition that could be recognized by ECA. I haven't looked at all the code there, but I couldn't find anything that would have indicated a workflow transition. That's why they implemented a special case, just for their way of dealing with workflows, it appears.
- Status changed to Fixed
over 1 year ago 9:46am 30 June 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- πΊπΈUnited States alex.verhoeven
I am also experiencing this issue. I think it probably does relate to the core issue https://www.drupal.org/project/drupal/issues/3346430 π Wrong revision can be loaded into original in \Drupal\Core\Entity\EntityStorageBase::doPreSave Needs work
To reproduce:
- Create new node as Draft
- Change state to Review
- The model recognizes the state change and executes the email action
- Change state back to Draft
- The model recognizes the state change and executes the email action
- Change state to Published
- The model recognizes the state change and executes the email action
- Create a new Draft on the existing node
- Change state to Review
- The model recognizes the state change and executes the email action
- Change state back to Draft
- The model DOES NOT recognize the state change and does not execute the action
So this only happens for me when I'm working with a new draft on an existing, published node
- Status changed to Fixed
about 1 year ago 6:50am 4 September 2023 - π©πͺGermany jurgenhaas Gottmadingen
I am also experiencing this issue. I think it probably does relate to the core issue https://www.drupal.org/project/drupal/issues/3346430 π Wrong revision can be loaded into original in \Drupal\Core\Entity\EntityStorageBase::doPreSave Needs work .
Yes, that's caused by that core bug. There are several attempts to fix that, but I'm not sure how far back this fix will be ported from 11. You may want to apply a patch to core which resolves that in older versions.