- ๐บ๐ธUnited States smustgrave
This came up as a #bugsmash daily issue.
I tried replicating on a fresh Drupal install
Installed the Content Moderation module (which installed Workflows)
And check the Content Moderated view and did not see any errors.Also checked the logs and did not see anything.
If there a step missing or can we say this issue has been resolved?
- Status changed to Active
over 1 year ago 6:21am 19 June 2023 - ๐ณ๐ฑNetherlands Lendude Amsterdam
Steps to reproduce:
* Do a minimal install of Drupal
** Install some themes and toolbar to not go crazy
* Enable Views module -> save
* Enable Content moderation
* Check Moderated content View
* See broken handlers: - ๐ณ๐ฑNetherlands Lendude Amsterdam
So to me, the problem here is that this View ships without a config dependency on this specific Workflow, which it should, since it has one.
Good thing is, if you install all this in something like Umami and then resave the View and check its dependencies, this workflow dependency is added, so it seems to be purely that the optional config is missing this.So to me, the easy solution here is to add that dependency to the View and then I shouldn't get installed if you don't have this Workflow.
- ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
I ran into the
broken/missing handler
issue mentioned in #21 ๐ The view installed by content moderation assumes the 'editorial' workflow installed by standard profile exists Needs review during todays weekly lean coffee call of the drupal user group munich. when i wanted to locally test an issue we were talking about in relation to content moderation i've noticed thebroken/missing handler
for the first time on a fresh install. after the call i've checked the issue queue for existing issues and arrived here.1. if you install 9.5 or 10.1 with the standard profile, then install the content moderation module, and finally check the
moderated content
view you will have abroken/missing handler
at the fourth position infields
and at the fourth and sixth position forfilter criteria
. took us a while to figure out, but the problem causing that issue is if you go toadmin/config/workflow/workflows/manage/editorial?destination=/admin/config/workflow/workflows
into theThis workflow applies to:
section, there is no entity type selected there. that is causing thebroken/missing handler
field and filter criteria entries. if you select at least one thebroken/missing handler
is gone on the view.
After that i've simply deleted theEditorial
workflow. i then revisited themoderated content
view again and i am able to reproduce theNo valid values found on filter: Content revision: Moderation state.
as described in the issue summary.2. if i install drupal with the minimal profile i get
broken/missing handler
described in #21 ๐ The view installed by content moderation assumes the 'editorial' workflow installed by standard profile exists Needs review . but there is no Editorial workflow installed. so in contrast to 1 i dont get theNo valid values found on filter: Content revision: Moderation state.
error but thebroken/missing handler
.I wonder if aside the suggestion in #22 ๐ The view installed by content moderation assumes the 'editorial' workflow installed by standard profile exists Needs review it would make sense to pre select at least one or two existing entity types in the standard profile (article and basic page, and/or basic block) for the editorial workflow?
- ๐บ๐ธUnited States bkosborne New Jersey, USA
I ran into this as well. Indeed, it seems the problem is that when the standard Workflow is deleted, that filter "Content revision: Moderation state (<> Published)" on the view no longer works. It gets changed to "Content revision: Moderation state (<> Unknown)" It must be fixed manually by editing the filter and selecting the appropriate "Published" state from the new workflow(s) on your site. Not sure there's a good way for the Content Moderation module to do this automatically?
- ๐บ๐ธUnited States thejimbirch Cape Cod, Massachusetts
The dependent configuration this view assumes could be moved or copied to this module's config/optional folder.
- Status changed to Needs review
about 1 year ago 8:19pm 29 September 2023 - last update
about 1 year ago 29,992 pass, 106 fail - ๐บ๐ธUnited States smustgrave
Something like this?
Added standard workflow to config/optional folder
Added dependency to workflows to view The last submitted patch, 26: 3088534-26.patch, failed testing. View results โ
- last update
about 1 year ago 30,355 pass, 1 fail - ๐บ๐ธUnited States smustgrave
Added a check to the test trait for creating the editorial workflow.
The last submitted patch, 28: 3088534-28.patch, failed testing. View results โ
- last update
about 1 year ago 30,378 pass - ๐บ๐ธUnited States smustgrave
Removed
// Test a node for a workflow that hasn't been updated to include the // 'default_moderation_state' setting. We must be backwards compatible with // configuration that was exported before this change was introduced. $this->assertFalse(isset($configuration['default_moderation_state']));
Felt it was testing something that is no longer true by adding the workflow config with content_moderation
- ๐ณ๐ฌNigeria chike Nigeria
Using Drupal 10.1.2, #9 ๐ The view installed by content moderation assumes the 'editorial' workflow installed by standard profile exists Needs review which is explained in more detail at #24 ๐ The view installed by content moderation assumes the 'editorial' workflow installed by standard profile exists Needs review worked for me.
- ๐ฉ๐ชGermany tstoeckler Essen, Germany
I had also found this before, see #3060633: Check that views do not get created with broken handlers โ . That is more about preventing something like this in general, though.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
It seems like we're copying the workflow. Should we be moving it from standard profile instead?
- ๐บ๐ธUnited States smustgrave
You mean remove it completely from standard? Will that mean the config should still be optional?
- ๐บ๐ธUnited States thejimbirch Cape Cod, Massachusetts
If moving it makes more sense, I think it belongs in config/install, as it doesn't have any other dependencies that would make it optional. In the standard profile, it is only dependent on this, the content_moderation module where it would be moved.
dependencies: module: - content_moderation
- last update
about 1 year ago 30,434 pass - @smustgrave opened merge request.
- ๐บ๐ธUnited States smustgrave
Moved into config/install and removed from standard profile.
Changed to MR because gitlab is way faster
- Status changed to RTBC
about 1 year ago 3:17pm 21 November 2023 - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
I think this looks great! I assume this needs a change record and release note.
I don't understand the removal of the assertion completely, but I guess it makes sense. (Discussed in #30).
- last update
about 1 year ago 30,605 pass - last update
12 months ago 30,634 pass - last update
12 months ago 30,675 pass - last update
12 months ago 30,678 pass - last update
12 months ago 30,684 pass - last update
12 months ago 30,688 pass - last update
12 months ago 30,681 pass, 2 fail - last update
12 months ago 30,688 pass - last update
12 months ago 30,696 pass 58:44 54:43 Running- last update
12 months ago 30,712 pass - last update
11 months ago 30,724 pass - last update
11 months ago 30,764 pass - last update
11 months ago 30,766 pass - last update
11 months ago 25,896 pass, 1,810 fail - Status changed to Needs work
11 months ago 3:41am 22 December 2023 - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
I know in #33 I said I thought we should be moving.
But after re-reading the comments on the issue, that by @Lendude in #22 seems like the correct fix.
i.e this view should not be installed if you don't have the workflow.
It doesn't sound like that was explored.
Can we explore that? It would be a one-line fix.
- ๐บ๐ธUnited States smustgrave
smustgrave โ changed the visibility of the branch 3088534-the-view-installed to hidden.
- Status changed to Needs review
11 months ago 5:34pm 3 January 2024 - Status changed to Needs work
11 months ago 8:46am 4 January 2024 - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Tests are green with the one liner. Manually tested with the steps to reproduce from the IS and the broken handlers are still present.
Steps to reproduce:
- Minimal drupal install
- Enabled Claro and Olivero, set as defaults
- Enable views & views UI -> install
- Enable Content moderation -> install
- Edit view "Moderated content" --> Broken handlers
- Check Configuration -> Workflow --> No workflowsScreenshot of the view config:
- ๐ฉ๐ชGermany tstoeckler Essen, Germany
I think the dependency should be on the editorial workflow config (
workflows.workflow.editorial
) not the workflow module itself. That should make sure there are no broken handlers. - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Hmm doesn't seem to work either. Changing that doesn't even get the content moderation view installed ๐ค
- ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Somewhat working:
dependencies: module: - node - user enforced: module: - content_moderation - workflows config: - workflows.workflow.editorial
Also copied the workflows.workflow.editorial.yml from the standard profile into the optional config.
This installs the modules, adds the editorial workflow and creates the view. But unfortunately, all 3 handlers remain broken and re-saving the view doesn't fix this.
- ๐ฉ๐ชGermany tstoeckler Essen, Germany
Hmm... maybe you are running into the issue I described over at #3060633: Check that views do not get created with broken handlers โ which is the ordering of the import. Not sure where you copied the workflow config to, but if you copied it into the Minimal profile it will be installed after the view, so at that point the view will already have been created with the broken handlers.
- ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Also copied the workflows.workflow.editorial.yml from the standard profile into the optional config.
Meaning into "core/modules/content_moderation/config/optional/". I did not copy it into the minimal profile. I also tried moving from /optional to /install but that has the same result.
- ๐บ๐ธUnited States smustgrave
So would the original MR work? Currently hidden
- ๐ฉ๐ชGermany tstoeckler Essen, Germany
Re #48, right, sorry, my explanation made no sense, with the dependency the view would not have been installed then. Not sure what ist going in then...
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
No that's right
We want the view to depend on the workflow
And we want it in optional condig - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Hmm, so now (my latest commit) we have the expected behaviour on minimal (no view nor workflow). But on the standard profile it's still showing 3 broken handlers.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
I manually tested #52 and got the same
The missing piece of the puzzle is you need to edit the workflow and enable it for some content types.
So I think the fix is that the copy of workflow.workflow.editorial that is in standard/config/optional needs to have it enabled for the content types (basic page, article)
- ๐ฉ๐ชGermany tstoeckler Essen, Germany
The missing piece of the puzzle is you need to edit the workflow and enable it for some content types.
๐ก๐ฐ Yes, that is exactly what was missing at least in my understanding of the issue. Thanks, I will wander the earth in a slightly less confused state now thanks to you. ๐
- Status changed to RTBC
11 months ago 8:03am 5 January 2024 - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Manually tested this again, and fixed one PHPCS remark. All looks good now!
- Status changed to Needs work
11 months ago 8:28am 5 January 2024 - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Actually there are two tests failing.
DefaultConfigTest https://git.drupalcode.org/issue/drupal-3088534/-/jobs/577863#L2612
ModeratedContentViewTest https://git.drupalcode.org/issue/drupal-3088534/-/jobs/577855#L1867