With 7.x-1.4 the default value of the moderation state in the node form is set to the default state. It would have more sense setting it to the actual moderation state like in 7.x-1.3, or not? Why it has been changed?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iStryker’s picture

For quicker response @MonJovis can you provide the issue that changed this, and add it as related issue.

Using git log -S 'the new line of code text' might help.

MonsJovis’s picture

caxy4’s picture

@MonsJovis I think I've provided a patch for what you report here: https://www.drupal.org/node/2446251

Let me know whether it suites your needs.

vikramy’s picture

Try attached patch. @caxy4 your patch did not work for this use case.

Zatox’s picture

Title: Node form: Set actual moderation state as default value » Node form: Set actual current moderation state as default value instead of the content type's default moderation state
Version: 7.x-1.4 » 7.x-3.0
Status: Active » Needs review
FileSize
2.12 KB

Here is a new version of the patch applied to 3.x
I added the two first changes because this patch would otherwise introduce a regression:
Without those a brand new node would have it's default state set to Draft instead of the content type's default and same thing when one would create a new Draft from an already published node.

Zatox’s picture

Added all the related issues I found. Seeing all the different approaches taken it seems that maybe the way to go would be to change the function workbench_moderation_state_none() instead of replacing most calls to it with
variable_get('workbench_moderation_default_state_' . $form['type']['#value'], workbench_moderation_state_none())
This is probably a discussions for another issue as changing this function would probably have tremendous implications and would likely introduce bugs.

I think this feature request is rather important as most content managers expect to only change what they willingly interact with on the edit page. The current behavior of loading the form with the content type's default moderation state instead of the current moderation state the revision being edited is in is quite risky.
For example if the default moderation state for the content type is 'Published' then a content editor wanting to simply edit typos in a draft might actually be publishing it by mistake ( Content managers don't always pay attention to the vertical tabs and the "hidden" settings they hold). Maybe the worst with this change in behavior is it's always worked in the intuitive/expected way but now, out of the blue, it changes.

delacosta456’s picture

hi @Zatox
i would like to suggest a label display of the current state a select list default state(near or under the labeled one) set to be none but with a validation.

All this the help avoid un expected and unwanted saving and log of moderation

mtoscano’s picture

I tested patch in comment #5 https://www.drupal.org/project/workbench_moderation/issues/2432957#comme... against current version 3.0 and it works fine.
Tx

i.koychev’s picture

Hi, I've tested the patch at #5 and it works. Thanks!