Warning: foreach() argument must be of type array|object, null given in workbench_access_view_check()

Created on 12 October 2022, about 2 years ago
Updated 14 February 2023, almost 2 years ago

Problem/Motivation

On Drupal 9.4.7, Php 8.1 and workbench_access 8.x-1.1 I am seeing this error on a View where the 'type' of handler is 'filter'.

Warning: foreach() argument must be of type array|object, null given in workbench_access_view_check() (line 271 of modules/contrib/workbench_access/workbench_access.module).

I can provide the config fo the View if that is helpful, but it's unclear why this is happening. Basically $view->getHandlers('filter') on this View returns 'null'. It might be best to put a null check prior to the foreach here.

Steps to reproduce

I have installed workbench_access and am rendering a complex View.

Proposed resolution

Add a null value check prior to

foreach ($view->getHandlers($type) as $items) { }
πŸ› Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024