- Issue created by @Ibrahim Tameme
- π¨πSwitzerland castellad@gmail.com
Hi Ibrahim,
You need to disable the permission under the module "content moderation".
If you have more information, i would be happy to help you.
Best regards - π―π΄Jordan Ibrahim Tameme
Hi thank you for the quick response, I did do that unless I'm missing something below is a screenshot of the content moderation page were I unchecked all the permissions and other page is for content moderation permissions and I added some permissions to check but it's not working still please tell me if i'm missing something.
- π§πͺBelgium Cyberwolf
What seems missing from the instructions is that you must also change the form field widget that is used for the 'Moderation state' field. By default the 'Moderation state' widget is used for this one, but you need to change this to 'Moderation state permissions', for each content type (path admin/structure/types/manage/[content-type]/form-display).
- πΊπΈUnited States recrit
@cyberwolf I agree. That is what the service's "decorates" property was meant to do. The "decorates" let's you extend the parent service -
content_moderation.state_transition_validation
in this case - without overriding the entire service.
I am working on a PR to do this.
We will be stuck with keeping the "Moderation state permissions" field widget to support existing sites using it. We could mark as deprecated since it is no longer needed. Alternatively, we could create an update to set them all back to Drupal core's field widget. - Merge request !4Issue #3469702: extend content_moderation.state_transition_validation by using a decorated service β (Open) created by recrit
- πΊπΈUnited States recrit
MR4 created with the following changes:
- Updated the service content_moderation_permissions.state_transition_validation to decorate core's service content_moderation.state_transition_validation so that the duplicated code from the content_moderation module is not needed.
- Removed the Field widget "moderation_state_permissions_default". An update is provided to set the widget configuration back to the "moderation_state_default".
- Removed the field constraint / Validation plugin: "ModerationStatePermissions"
- Status changed to Needs review
4 months ago 3:34pm 24 June 2025 - π§πͺBelgium Cyberwolf
@recrit overal the MR is looking good. I just added 2 minor suggestions to it.
Unfortunately it still seems to be necessary to extend the existing class due to other code that expects an instance of that particular class instead of any implementation of the interface, e.g. some contrib modules like scheduled_publish. It might be worth opening separate issues in those projects in order to eventually clean the last bits up, but IMHO this certainly shouldn't be blocking the MR.
- πΊπΈUnited States recrit
@cyberwolf thanks for the review. I'll make the updates when I get a few minutes.
For extending the core class - Yes, it was needed. Other modules such as https://www.drupal.org/project/gcontent_moderation β do the same by extending core's class.
For reference, I have gcontent_moderation installed along with content_moderation_permissions and they are working well together.