Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#5 | set_current_moderation_state_as_default_value-2432957-5.patch | 2.12 KB | Zatox |
|
Comments
Comment #1
iStryker CreditAttribution: iStryker commentedFor 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.Comment #2
MonsJovis CreditAttribution: MonsJovis commentedComment #3
caxy4 CreditAttribution: caxy4 commented@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.
Comment #4
vikramy CreditAttribution: vikramy commentedTry attached patch. @caxy4 your patch did not work for this use case.
Comment #5
Zatox CreditAttribution: Zatox commentedHere 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.
Comment #6
Zatox CreditAttribution: Zatox commentedAdded 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.
Comment #7
delacosta456 CreditAttribution: delacosta456 commentedhi @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
Comment #8
mtoscano CreditAttribution: mtoscano commentedI 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
Comment #9
i.koychev CreditAttribution: i.koychev commentedHi, I've tested the patch at #5 and it works. Thanks!