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.
(1) install the module
(2) log in as a role which has no workbench-related permissions (but has the permission to create a page)
(3) go to node/add/page
I get the message
Notice : Undefined index: workbench_moderation_state_new in workbench_moderation_form_node_form_alter() (line 859 of workbench_moderation/workbench_moderation.module).
Cheers,
Albert.
Comments
Comment #1
Darshi Shah CreditAttribution: Darshi Shah commentedI am also having the same notice but with different line number. I am using dev version.
Notice: Undefined index: workbench_moderation_state_new in workbench_moderation_form_node_form_alter() (line 866 of workbench_moderation/workbench_moderation.module).
I am using msnf module and this error appears on last step of adding content where moderation notes are there.
Thanks
Comment #2
pkil CreditAttribution: pkil commentedtry the following:
http://drupal.org/node/1606704
Comment #3
pfrenssenThe issue mentioned in #2 is about a problem in Workbench Moderation Notes and is unrelated to this issue.
I can confirm this notice occurring when logged in as a user that has no workbench moderation permissions. When I add the "bypass workbench moderation" permission to the user role the notice disappears.
Comment #4
jmoughon CreditAttribution: jmoughon commentedHere is patch that does a simple check to see if the $form['revision_information']['workbench_moderation_state_new'] is set.
Comment #5
jmoughon CreditAttribution: jmoughon commentedLeft out a ) sorry.
Comment #6
alberto56 CreditAttribution: alberto56 commentedSet the previous patch to needs review so it gets tested.
Comment #8
jmoughon CreditAttribution: jmoughon commentedLets see if this works
Comment #9
jmoughon CreditAttribution: jmoughon commentedNeeds review
Comment #11
jmoughon CreditAttribution: jmoughon commentedTrying again
Comment #12
pfrenssenIt's not needed to enclose the ternary operator in parentheses. The assignment operator
=
has lower precedence than the ternary operator. See Operator precedence.Comment #13
aspilicious CreditAttribution: aspilicious commentedCan we get a quick reroll? Needed to patch this.
Happens with users that only can edit draft versions without extra permissions.
Comment #14
yareckon CreditAttribution: yareckon commentedComment #16
rbrandon CreditAttribution: rbrandon commented@yareckon that is correct. @jmoughon your patch looks good, applying the small change yareckon mentions so this can be closed/committed.
Comment #17
heddnIf the testbot likes this, then RTBC. I'm using the patch on a site that is going live in the next few weeks and it resolves the issue.
Comment #18
heddnComment #19
ladybug_3777 CreditAttribution: ladybug_3777 commentedCan we get this committed yet? The patch at #16 works great for me.
Comment #20
DamienMcKennaDoes it still apply against v7.x-1.x-dev?
Comment #22
lukusPlease commit this .. #16 working well for me also.
Thanks.
Comment #23
AlexKirienko CreditAttribution: AlexKirienko commented#16 working on 7.x-1.3+10-dev
Comment #24
rv0 CreditAttribution: rv0 commented+1 for #16
Comment #26
colanThanks!