Needs review
Project:
Publish Content
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2019 at 18:17 UTC
Updated:
18 Mar 2024 at 23:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eloivaqueComment #3
jhuhta commentedFrom what I've understood, if a site has Content moderation enabled for a certain node type, then Published (status) value of that node type should not be altered by this module. So no, this is not compatible with Content moderation, but the modules can peacefully co-exist.
I wrote a simple patch to disable the functionality of this module in those cases.
Comment #4
sokru commentedLooks good to me.
Comment #5
rodrigoaguileraWhen a site builder enables content moderation for a content type I think is their responsibility to also set the proper permissions for this module.
If this this a big pain point I think the best approach is to hook into the action of enabling content moderation for a content type and remove all permissions that this module sets for that content type informing the user about that automatic change in configuration.
Comment #6
jhuhta commentedFair enough, let's not do that then.
But the module is not exactly working as designed, so reopening:
When editing a node of a type with Content Moderation enabled and no publish permission given, we get an error: "Notice: Undefined index: #access in path/docroot/modules/contrib/publishcontent/publishcontent.module on line 27". This simple patch should fix that.
Comment #8
rodrigoaguileraPerfect, let's get rid of that notice
Comment #9
lilune commentedHello,
Desactivate Access to Publish Content is your compatibility with content moderation ?
INTRODUCTION :
I needed the moderation state and the publish/unpublish Link & Local Task at the same time.
So, I created a patch for publish content who check the existence of content moderation states.
I use three states for content moderation : draft / submitted / published
If I want unpublish a node with publish content, i want to change it state as a draft.
EXPLANATION :
So, I patched the module like that :
1 - I modified the module page settings (PublishContentSettings.php) to check the existence of content moderation module.
I load the node types who have a initiated "workflow" : workflowBundle
And for each workflowBundle :
- I load all workflow states and dispatch them on two groups : publishStates and unpublishStates
- I add a fieldgroup per node type with three fields :
2 - I modified the toggleEntityStatus controller function (PublishContentPublishEntity.php) to check existence of content moderation module.
I load the selection of publish and unpublish states depending on node bundle from module settings.
I set the moderation state field with the newState loaded.
3 - I keep the disable function if the checkbox in settings is selected (PublishContentAccess.php)
REMAINS :
I encountered two problems with my patch.
1 - With content moderation, the default revision is unchecked for the draft state. So, for unpublish the publish content, Drupal create a new revision and keep the old revision published.
I test to load the last revision in Publish Content module but it doesn't work, the publish/unpublish link changes well but not the node status.
So, i create a patch for Content Moderation to init draft state with default revision but we have to reinstall the module to make it work.
It works well for me because I'm on development of migration a D7 version but it's not right to do for a production version, people might lose configuration data.
Maybe a form_alter to do ? Or any other ideas ?
2 - I haven't tested with website multilingual, because my actual project doesn't need it. Someone can test that ?
TRANSLATION :
I do the french translation, I extracted the po file with potx module.
Can you integrate that in PublishContent module ? I don't know how to do that.
Comment #10
lilune commentedComment #11
lilune commentedI get an other notice php :
I include the fix with the #6 patch in mine.
I also define another permission than "access administration pages" because a customer doesn't have to configure this module.
Comment #12
webdrips commentedRe-rolling #11 for 1.6, and had to rework some parts of the code. We make some assumptions in the code, but it should work as long as the defaults are used for published and un-published states (published and archived, respectively).
The code should also check if the transitions are allowed, but that gets bypassed right now.