Problem/Motivation

Deprecated function: Using null as an array offset is deprecated, use an empty string instead in Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm->viewsFormSubmit() (line 923 of modules/contrib/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php).

We get this error when on PHP 8.5.

Steps to reproduce

Drupal 11, PHP 8.5

Proposed resolution

In viewsFormSubmit() of the VBO bulk form, normalize the submitted bulk-input list by defaulting to an empty array and skipping NULL/empty values before using each item as an array key, preventing PHP 8.5’s ‘null as array offset’ deprecation while preserving selection behavior.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gashunk created an issue. See original summary.

gashunk’s picture

Status: Active » Needs review
graber’s picture

Status: Needs review » Postponed (maintainer needs more info)

A bulk form key with NULL value is strange and shouldn't ever be a case under normal circumstances (it's a form checkbox value). Please provide steps to reproduce the issue.

graber’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

I see this is an issue in latest PHPUnit actually.. Fixing it in #3589897: Code cleanup, service autowiring improvements., I'll credit you @gashunk, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.