- Issue created by @sboden
- 🇩🇪Germany drubb Sindelfingen
Just to clarify: you've upgraded Drupal core, but presumably not the D8 version. So from 10.1.7 to 10.2.1, right?
- 🇩🇪Germany axroth Stuttgart
> from 10.1.7 to 10.2.1, right?
yes, that is correct. Issue persists with 10.2.2 too.
Yes, also correct for me. I did an upgrade from Drupal 10.1.7 to 10.2.1 with composer and then it breaks. Later on I tried 10.1.8 that works, Upgrade to 10.2.2 breaks.
I have the problem locally in a ddev environment and also on our ECS test environment on AWS with a CI-CD flow, so the environment is always clean (no left-overs of code or so), "drush updb" is properly run, ...
When I'm on Drupal 10.1.x and I run "drush route" entity.workflow_state.canonical is also not in the output. So my current assumption is that something in Drupal 10.2 triggers that route while it's not supposed to be triggered.
On the node views where it breaks I have an EVA to show the workflow history.
- 🇩🇪Germany drubb Sindelfingen
Check the View that is rendered here, obviously. If it renders workflow states, they should NOT be linked to the workflow state entity, as workflow states don't have canonical urls.
I checked the EVA view involved, it looks ok to me:
- The fields in the EVA are all fields from the Workflow category: From State, To State, ...
- Entity content setting is type "Content", Arguments is "id".
- It has a contextual filter "Workflow: Entity ID" which takes default value of "id in URL"The EVA shows the list of workflow transitions of the node it's on.
It does work in 10.1.x, but not in 10.2.x
- 🇩🇪Germany drubb Sindelfingen
Did you check the columns (Views fields) 'From State' and 'To State'? There's a checkbox, something like 'Link label to the referenced entity', this MUST be unchecked!
#7 stops the error from occurring so that's good, thanks.
Is there a way to make it more error-proof? Disable "something" so the link to entity option doesn't appear in views for from/to state, e.g. the Log Message and Transaction ID field just don't have that option to link to an entity. Alternatively make workflow work with the option, but I guess that wouldn't make much sense. Or a hook that scans the fields in views to switch off the option.
- 🇩🇪Germany drubb Sindelfingen
IMHO this is a core Views issue. Views should hide the checkbox and prevent linking to entities that don't have a canonical route / url.
I'm not sure what has been changed from Drupal 10.1 to 10.2. Maybe this failed silently before, and now throws an error.
I guess there's nothing Workflows or EVA can do to fix this. - 🇳🇱Netherlands johnv
Are you upgrading from Drupal 10.1 to 10.2. or from Drupal 8.1 to 8.2?
please check other issues with 'canonical'. There has been lots done in the past.
Some modules assume it to be there, but the module Workflow does not need it. - 🇳🇱Netherlands johnv
Are you upgrading from Drupal 10.1 to 10.2. or from Drupal 8.1 to 8.2?
please check other issues with 'canonical'. There has been lots done in the past.
Some modules assume it to be there, but the module Workflow does not need it. The problems occurs when upgrading from Drupal 10.1.x to 10.2.x: it works in 10.1.7 and 10.1.8, it breaks as of 10.2.1 (I didn't try 10.2.0)
My problem was solved with #7 above. In a view I have the "From state" and "To state" element had the checkbox on for "Link label to the referenced entity". The canonical view for workflow state never existed but in Drupal 10.1.x it gets ignored, while in Drupal 10.2.x it breaks.
The solution is not to switch on the option "Link label to the referenced entity". Better option would be for views not to show the checkbox when the element does not have a canonical view.
This issue can be closed. The short term solution is as suggested in #7 not to switch on the "Link label to the referenced entity" for the workflow fields that don't have a canonical view (e.g. "From state" and "To state").
Follow up issue at https://www.drupal.org/project/drupal/issues/3415993 ✨ "Link label to the referenced entity" changed behavior from Drupal 10.1 to 10.2 Active . It would be nicer when the "Link label to the referenced entity" would not be shown in the settings for fields that don't have a canonical view, or fail silently when displaying the view instead of getting a WSOD.
The behaviour of this changed from 10.1.x to 10.2.x, in 10.1.x it would be silently ignored.
- Status changed to Closed: works as designed
10 months ago 11:27am 1 February 2024 - 🇳🇱Netherlands johnv
As per comment #7: offending "submit" link → , the problem is solved by removing the link using the canonical route in the EVA Field.
Please also check 📌 [Meta] Route "entity.workflow_state.canonical" does not exist ActiveThe link should not be generated, since it has no usage in the Workflow module.
As a maintainer, thanks for helping eachother out.