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.
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).
Comment | File | Size | Author |
---|---|---|---|
#14 | 1935190-wa-array-keys_0.patch | 1.42 KB | agentrickard |
#13 | 1935190-wa-array-keys_0.patch | 2.24 KB | agentrickard |
#10 | 1935190-wa-array-keys.patch | 1.53 KB | agentrickard |
#6 | 1935190-wa-array-keys.patch | 837 bytes | agentrickard |
#4 | workbench_access.png | 31.99 KB | Jonathan Baltazar |
Comments
Comment #1
webfleck CreditAttribution: webfleck commentedThe 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)
Comment #2
agentrickardThese warnings look ugly but are harmless.
Comment #3
agentrickardCannot replicate with the stock install. Please send a screen shot of your workbench access configuration. (From admin/config/workbench/access/settings.)
Comment #4
Jonathan Baltazar CreditAttribution: Jonathan Baltazar commentedHere are my workbench access settings.
Comment #5
agentrickardInteresting. I assumed you were using Fields. Thanks.
Comment #6
agentrickardThis patch should correct the issue.
Comment #8
agentrickard#6: 1935190-wa-array-keys.patch queued for re-testing.
Comment #10
agentrickardAnd fixed the failing test.
Comment #11
Jonathan Baltazar CreditAttribution: Jonathan Baltazar commentedThis 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).
Comment #12
agentrickardThanks. Setting proper status, since there is a patch file.
Comment #13
agentrickardHere's a version that accounts for that.
Comment #14
agentrickardFixed a test bug elsewhere in the code.
Comment #16
agentrickard#14: 1935190-wa-array-keys_0.patch queued for re-testing.
Comment #18
agentrickardAlso the wrong damn version.
Comment #19
agentrickard#14: 1935190-wa-array-keys_0.patch queued for re-testing.
Comment #20
micahw156The patch made the errors go away for me.
Comment #21
agentrickardComment #22
agentrickardCommitted.
Comment #23.0
(not verified) CreditAttribution: commentedRedacted information.