(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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Darshi Shah’s picture

I 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

pkil’s picture

pfrenssen’s picture

The 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.

jmoughon’s picture

Here is patch that does a simple check to see if the $form['revision_information']['workbench_moderation_state_new'] is set.

jmoughon’s picture

Left out a ) sorry.

alberto56’s picture

Status: Active » Needs review

Set the previous patch to needs review so it gets tested.

Status: Needs review » Needs work

The last submitted patch, workbench_moderation-indefined-index-1944058-5.patch, failed testing.

jmoughon’s picture

Lets see if this works

jmoughon’s picture

Status: Needs work » Needs review

Needs review

Status: Needs review » Needs work

The last submitted patch, workbench_moderation-indefined-index-1944058-8.patch, failed testing.

jmoughon’s picture

Status: Needs work » Needs review
FileSize
865 bytes

Trying again

pfrenssen’s picture

It's not needed to enclose the ternary operator in parentheses. The assignment operator = has lower precedence than the ternary operator. See Operator precedence.

aspilicious’s picture

Can we get a quick reroll? Needed to patch this.
Happens with users that only can edit draft versions without extra permissions.

yareckon’s picture

Status: Needs review » Needs work

The last submitted patch, 1944058-notice-in-workbench-moderation.patch, failed testing.

rbrandon’s picture

@yareckon that is correct. @jmoughon your patch looks good, applying the small change yareckon mentions so this can be closed/committed.

heddn’s picture

Status: Needs work » Needs review

If 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.

heddn’s picture

Status: Needs review » Reviewed & tested by the community
ladybug_3777’s picture

Can we get this committed yet? The patch at #16 works great for me.

DamienMcKenna’s picture

Version: 7.x-1.3 » 7.x-1.x-dev

Does it still apply against v7.x-1.x-dev?

lukus’s picture

Please commit this .. #16 working well for me also.

Thanks.

AlexKirienko’s picture

#16 working on 7.x-1.3+10-dev

rv0’s picture

+1 for #16

  • colan committed 602a2d4 on 7.x-1.x authored by rbrandon
    Issue #1944058 by jmoughon, rbrandon, yareckon: Check for array element...
colan’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks!

  • colan committed 602a2d4 on 7.x-3.x authored by rbrandon
    Issue #1944058 by jmoughon, rbrandon, yareckon: Check for array element...