When editing a node, the "Preview" option throws this error:

  • Warning: array_keys() expects parameter 1 to be array, string given in workbench_access_node_form_element() (line 1467 of sites\all\modules\workbench_access\workbench_access.module).
  • Warning: Invalid argument supplied for foreach() in workbench_access_node_form_element() (line 1468 of sites\all\modules\workbench_access\workbench_access.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webfleck’s picture

Priority: Normal » Critical

The Same here I got the following errors. Please help:
Warning: array_filter() expects parameter 1 to be array, string given in workbench_access_node_access() - Line (line 399)
Warning: Invalid argument supplied for foreach() in workbench_access_check()(line 447)
and
Warning: array_keys() expects parameter 1 to be array, string given in workbench_access_node_form_element() (lines 1465 and 1466)

agentrickard’s picture

Priority: Critical » Normal

These warnings look ugly but are harmless.

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)

Cannot replicate with the stock install. Please send a screen shot of your workbench access configuration. (From admin/config/workbench/access/settings.)

Jonathan Baltazar’s picture

FileSize
31.99 KB

Here are my workbench access settings.

agentrickard’s picture

Status: Postponed (maintainer needs more info) » Active

Interesting. I assumed you were using Fields. Thanks.

agentrickard’s picture

Status: Active » Needs review
FileSize
837 bytes

This patch should correct the issue.

Status: Needs review » Needs work

The last submitted patch, 1935190-wa-array-keys.patch, failed testing.

agentrickard’s picture

Status: Needs work » Needs review

#6: 1935190-wa-array-keys.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1935190-wa-array-keys.patch, failed testing.

agentrickard’s picture

Status: Needs work » Needs review
FileSize
1.53 KB

And fixed the failing test.

Jonathan Baltazar’s picture

Status: Needs review » Active

This problem has been fixed in general, but the issue still exists when the user role "delete any content" is disabled for a node type. The preview button throws this error:

Warning: array_filter() [function.array-filter]: The first argument should be an array in workbench_access_node_access() (line 399 of workbench_access/workbench_access.module).

Warning: Invalid argument supplied for foreach() in workbench_access_check() (line 447 of workbench_access/workbench_access.module).

agentrickard’s picture

Status: Active » Needs work

Thanks. Setting proper status, since there is a patch file.

agentrickard’s picture

Status: Needs work » Needs review
FileSize
2.24 KB

Here's a version that accounts for that.

agentrickard’s picture

Fixed a test bug elsewhere in the code.

Status: Needs review » Needs work

The last submitted patch, 1935190-wa-array-keys_0.patch, failed testing.

agentrickard’s picture

Status: Needs work » Needs review

#14: 1935190-wa-array-keys_0.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1935190-wa-array-keys_0.patch, failed testing.

agentrickard’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Needs work » Needs review

Also the wrong damn version.

agentrickard’s picture

#14: 1935190-wa-array-keys_0.patch queued for re-testing.

micahw156’s picture

The patch made the errors go away for me.

agentrickard’s picture

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

Status: Reviewed & tested by the community » Fixed

Committed.

   b2eda51..9e9638c  7.x-1.x -> 7.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Redacted information.