Update form displays when workflow is changed

Created on 18 February 2023, about 2 years ago
Updated 28 February 2023, about 2 years ago

In #3298371-10: Can't save some nodes after updating to 8.x-1.4 comment #10 there are steps to reproduce a problem of not being able to save an entity. This is a separate issue and should be investigated independently.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom jonathan1055

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • 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

    1. Install Core Content Moderation and Scheduler module
    2. Enable Page for scheduling
    3. Enable SCMI module
    4. Add Page to default workflow and save
    5. Create a new page
      • We get the scheduler fields as expected.
      • Should see the scmi state fields but they are not shown
    6. 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 with canModerateEntitiesOfEntityType() it might make things easier.

    Just wanted to add my initial ideas, the above is not a fully thought-out solution.

Production build 0.71.5 2024