I am in a completely updated status with
Drupal 8.5.1 and all modules updated including:

Workbench 8.x-1.0
Workbench Access 8.x-1.0-beta1
Workbench Moderation 8.x-1.3

So I thought I would try and take the final step (I thought) in getting the states going etc.

Unfortunately, when I tried to Enable Moderation States for “posts” I ran into a major issue!

Here’s the result:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\content_moderation\Entity\Handler\NodeModerationHandler::onBundleModerationConfigurationFormSubmit() in Drupal\workbench_moderation\Form\BundleModerationConfigurationForm->submitForm() (line 184 of modules\workbench_moderation\src\Form\BundleModerationConfigurationForm.php). 
Drupal\workbench_moderation\Form\BundleModerationConfigurationForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('node_type_moderation_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('node_type_moderation_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

See screenshots leading to the error(s)

Figure 1 Ready to enable Moderation!

Figure 2 After Submitting Form
Can you tell me where I am going wrong?

CommentFileSizeAuthor
WA-Enable1.jpg93.23 KBbas123
WA-Enable2.jpg233.51 KBbas123

Comments

bas123 created an issue. See original summary.

agentrickard’s picture

Looking at this error and the code involved, it looks like you have both Workbench Moderation and Content Moderation enabled. The two modules perform the same function.

It looks like Drupal is getting confused here:

 $this->entityTypeManager->getHandler($bundle->getEntityType()->getBundleOf(), 'moderation')->onBundleModerationConfigurationFormSubmit($bundle);

And trying to call Content Moderation when it should be calling Workbench Moderation.

Try disabling one of those modules. You cannot use them both at the same time.

bas123’s picture

Thank you agentrickard, this is what I suspected...

I had Content Moderation checked when I was first looking for this solution and it was in "Experimental" stage.

Later I installed the Workbench modules but had issues with one of them (which are now resolved).

Now that both solutions are functional, I was hoping I could investigate both to see which worked best for my needs, however I obviously cannot use either because they are in conflict with one another; as evidenced by this issue!

I tried to uncheck each module at "admin/modules" (Extend), but both are grayed and cannot simply be turned on and off!

This paragraph in the "Workbench Moderation" module page has always confused me"
Since Drupal 8.2.x this module is in core as "Content Moderation". However it is an experimental module and therefore in an alpha stage, prone to API breaking changing. We hope to provide an upgrade path from Workbench Moderation to Content Moderation. Content Moderation stores moderation states differently, so can be uninstalled, please take a look and submit bugs / feedback via the core issue queue.

Since Content Moderation is now fully in Core, and involves one module to deal with, I suspect (given the choice) that I'd look at that solution first (all due respect to you and those involved in the Workbench suite). Or does the above statement indicate that Workbench 8.x-1.0 and Workbench Access 8.x-1.0-beta1 will work with Workbench Moderation 8.x-1.3 AND Content Moderation, but not both?

Any (specific) guidance would be appreciated in as much as my research hasn't yielded a method for disabling a module that cannot be uninstalled!
Workbench Moderation has a stable release for Drupal 8 ready for use in production. One thing to note is the module cannot be uninstalled due to the way moderation states are stored on entities.

The next step for me either way, it seems, is to figure out HOW to disable one or the other without breaking anything.

Thanks!

agentrickard’s picture

Workbench and Workbench Access are entirely independent and work with either module. They are not relevant here.

You probably can't uninstall the module because there is data in the database for it -- this is a safeguard that Drupal uses to prevent you from deleting data.

You likely have to delete any content under moderation in order to uninstall the module(s).

Personally, I would probably use Content Moderation at this point, but haven't done much research.

bas123’s picture

Thank you again agentrickard, however I haven't assigned any content to moderation.

I have used the workbench to access edit items but have never been able to apply any sort of Moderation "States" to any of my content...

Oh, I have assigned some of my posts using "The editorial section for this content." Dropdown. in anticipation of being able to use the "Editorial" States... But isn't that field part and parcel of the Workbench Access Module?

If not, I could locate and unassign those posts where that field was used! Would that free up the database restriction?

Is anyone directly involved in this module monitoring this thread?

larowlan’s picture

Category: Bug report » Support request
Priority: Major » Normal

There is a moderation tab when you edit the content type if you're using workbench moderation
Enable moderation there.

If you're using content moderation, enable it from the workflows menu under configuration.

This is a support request. These modules work together

bas123’s picture

larowlan, respectively!

Please do me a favor, and actually READ this from the original thread!

Which includes screenshots!

Whenever I enable EITHER one, the error appears.

The good news is that I can back up and undo the setting to enable either one and the error message goes away.

I just confirmed that by enabling the Content Type "Posts", in the configuration workflows and then trying to edit a Post, the error dialoge reappears (as above).

If you read agentrickard's (lead contributor for Workbench Access) reply above:

It looks like Drupal is getting confused here:

$this->entityTypeManager->getHandler($bundle->getEntityType()->getBundleOf(), 'moderation')->onBundleModerationConfigurationFormSubmit($bundle);

It appears that THEY DO NOT WORK TOGETHER! or some other issue is at play...

Bottom line, I do know how to activate the modules, but when I attempt that, its a "no go"!

I am unable to deactivate either one to troubleshoot them separately!

This is why I need assistance!

Please reinstate the status of this issue, it is NOT a support request but a BUG!

Thank you very much!

bas123’s picture

bas123’s picture

With some feedback from 'das-peter', I was able to resolve my issue and feel it important to document that process for anyone else who my come across this or a similar problem!
Thanks also to 'agentrickard' for his continued support and expertise

My conclusion in short is that NO, these two Modules DO NOT work together! (Well certainly not under the conditions I was working under)

Having never used the Module "Uninstall" feature in Admin and with concerns over the dependencies which seem to have been described as significant, I was hesitant to attempt this in the browser environment. However using a local distribution, I succeeded in troubleshooting and resolving the conflict while also being able to review the two Modules to determine which best suited my needs! - I have not yet attempted this in Production!

Below is my process and conclusions!

In short:

Using the Uninstall screen:
After disabling "Workbench Moderation",

I then enabled "Content Moderation", all worked as hoped!

Then I uninstalled "Content Moderation" and reinstalled Workbench Moderation...

Which seemed to configure OK and the permissions seemed OK as well, But when I tried to edit ANY Post:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: The state &#039;&#039; does not exist in workflow.&#039; in <em class="placeholder">Drupal\workflows\Plugin\WorkflowTypeBase-&gt;getState()</em> (line <em class="placeholder">155</em> of <em class="placeholder">core\modules\workflows\src\Plugin\WorkflowTypeBase.php</em>). <pre class="backtrace">Drupal\content_moderation\Plugin\WorkflowType\ContentModeration-&gt;getState(NULL) (Line: 351)
Drupal\content_moderation\EntityTypeInfo-&gt;formAlter(Array, Object, &#039;node_mt_post_edit_form&#039;) (Line: 145)
content_moderation_form_alter(Array, Object, &#039;node_mt_post_edit_form&#039;) (Line: 539)
Drupal\Core\Extension\ModuleHandler-&gt;alter(&#039;form&#039;, Array, Object, &#039;node_mt_post_edit_form&#039;) (Line: 830)
Drupal\Core\Form\FormBuilder-&gt;prepareForm(&#039;node_mt_post_edit_form&#039;, Array, Object) (Line: 272)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;node_mt_post_edit_form&#039;, Object) (Line: 74)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

So here is what I did next:

I uninstalled "Workbench Moderation" and noticed that "Content Moderation" was still showing up in the Uninstall Screen
This didn't show the previous "states" as before but did show the Workflow "Editorial" so I uninstalled Content Moderation again!

Search "Moderat" in Uninstall was empty!

Then I tried to reinstall Workbench moderation!

Module Workbench moderation has been enabled.

Then I ran update.php

No pending updates.

I then ENABLED Moderation States for Content Type "Posts" which did seem to take without any errors!

Workbench Moderation seems to be working correctly (out of the box / or at leaste as I had modified it prior to uninstalling).

History and REVIEW

Content Moderation was installed first while in it's Experimental State.
It was updated when Core was updated to 8.5.0

Workbench Moderation was installed while Content Moderation was installed (and went thru it's incarnations to stable)
Workbench; Workbench Access; & Workbench Moderation were all installed while Content Moderation was already installed but in experimental stage!
All Workbench Modules were updated as called for and now are in current status (Workbench 8.x-1.0, Workbench Access 8.x-1.0-beta1, Workbench Moderation 8.x-1.)

CONCLUSION

At least in my case (above), Content Moderation & Workbench Moderation DO NOT WORK TOGETHER and MAY NOT BOTH BE INSTALLED AT THE SAME TIME!

In order to be able to review/compare their functions, I had to:

1) Review Content Moderation

A) Uninstall Workbench Moderation (one pass)
B) Update Db
C) Testing showed no issues
a) Only three default states and minimal transitions (more may be added).
b) Simple clean but minimal interface (select box at bottom of content near the "Publish" checkbox).

2) Review Workbench Moderation

A) Uninstall Content Moderation (Two+ step process).
a) "States" must be uninstalled then "Editorial" must be removed!

B) Update Db
C) Testing showed no issues (After completely removing Content Moderation).
a) Multiple preconfigured Moderation States and Transitions.
b) Styled Dropdown Button for transitioning.

3) This was all tested in my local deployment via browser in the Acquia Dev Desktop.
It has not been field tested yet but I am confident to proceed with my Pre-Production Site

4) I my application my "Contributors" will be novice posters with little or no experience bewond a WYSIWYG text editor.
A) The Contributor will be granted a "Blog" Space as their content (as a Post).
B) Simplicity and ease of use on their end is key and must be as dummy proof as possible!
C) I will need to train them on how the states and transitions work.

Request: Does anyone know of a document that might explain this process to a novice such as my potential contributors?\

My Humble SUGGESTION

Anyone looking to test / evaluate / compare The core v 8.5.+"Content Moderation" module against "Workbench Moderation" module MUST Completely Uninstall one before trying the other!

This or a similar note should be added to each of these Module's overview by their maintainers!

larowlan’s picture

Title: Cannot activate Moderation for content type » Cannot activate Moderation for content type - module is not compatible with Content Moderation in core
Status: Active » Fixed

Right, this module should never be used at the same time as content moderation in core.

I've updated the project page to clarify.

tl;dr Don't use this module for new projects - use the core content_moderation module.

If you've got an existing site with workbench moderation, keep using it and move to the core module when you have time/budget/nothing better to do.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

isalmanhaider’s picture

Received the same on

- Drupal 10.1.4
- workbench_moderation: 8.x-1.7
- PHP: 8.2.6

Error: Call to undefined method Drupal\content_moderation\Entity\Handler\NodeModerationHandler::onBundleModerationConfigurationFormSubmit() in Drupal\workbench_moderation\Form\BundleModerationConfigurationForm->submitForm() (line 189 of modules/contrib/workbench_moderation/src/Form/BundleModerationConfigurationForm.php).

kristen pol’s picture

Just ran into this as I was testing some compatibility stuff with another module. IMO, workbench_moderation should not install at all if content_moderation is installed. That would solve this DX issue easily.