- Issue created by @jonathan1055
- 🇬🇧United Kingdom jonathan1055
The publish_state and unpublish_state fields are hidden by default, and are set to be displayed on saving the entity type form. This was done in #3317999: Set publish_state fields to be hidden by default → . But the content type could already be enabled for scheduling and then added to a moderation workflow. There would be no Entity Type form submit to trigger the update of the form displays. I think this is what @smustgrave found in #10 on #3298371: Can't save some nodes after updating to 8.x-1.4 →
- 🇬🇧United Kingdom jonathan1055
I have been trying a new sequence to demonstrate the problem
- Install Core Content Moderation and Scheduler module
- Enable Page for scheduling
- Enable SCMI module
- Add Page to default workflow and save
- Create a new page
- We get the scheduler fields as expected.
- Should see the scmi state fields but they are not shown
- Edit existing page has the same problem
It is fixed by editing the entity type form (saving the edit tab, it is not fixed if saving the form display, because the fields are hidden and we do not override that).
So do we need the fields to be enabled/displayed when the entity type is added to the workflow? It also depends on whether we use
$moderation_information->canModerateEntitiesOfEntityType()
or$moderation_information->isModeratedEntityType()
becuase that critical difference is saying "the content bundle could be added to a workflow" vs "the content bundle is added to a workflow". I have not fully checked this yet, but I have a hunch that if we stick withcanModerateEntitiesOfEntityType()
it might make things easier.Just wanted to add my initial ideas, the above is not a fully thought-out solution.