in_array(): Argument #2 ($haystack) must be of type array, bool given in ViewsBulkOperationsActionManager.php on line 102

Created on 23 December 2022, almost 2 years ago
Updated 7 November 2023, about 1 year ago

Problem/Motivation

the specified line reads:

if (!\in_array('Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionInterface', \class_implements($definition['class']))) {

the problem seems to be that 'class_implement()' can also return FALSE, when class not implements. Thus give the wrong type to 'in_array'

Steps to reproduce

Not sure how to reproduce

Proposed resolution

Check whether if( \class_implements() !== FALSE)

Remaining tasks

create patch

🐛 Bug report
Status

Closed: works as designed

Version

4.1

Component

Core

Created by

🇳🇱Netherlands Rop Rotterdam

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.

  • 🇬🇧United Kingdom andrew robinson

    I understand and appreciate the reasons for closing this ticket.

    In case it helps anyone stumbling across this problem in future:
    I experienced this problem due to a typo in the namespace of my custom action class file.
    My advice would be to check the namespace, and also to check that your class name matches the filename of your action class.

Production build 0.71.5 2024