[warning] Trying to access array offset on value of type bool PluginBase.php:185

Created on 1 October 2022, over 1 year ago
Updated 1 June 2023, about 1 year ago

Problem/Motivation

After updating to php 8.1 on drupal 9.3.22, an warning is thrown when clearing the cachce
[warning] Trying to access array offset on value of type bool PluginBase.php:185

This problem is caused by Views Plugins that do not correctly define the options array as specified in the documentation for the defineOptions() function in the Drupal\views\Plugin\views\PluginBase class.

Steps to reproduce

  1. Create a views plugin that does not implement the correct options array structure.
  2. Try to use that plugin.
  3. Observe PHP warnings.

Software versions

  • PHP 8.1
  • Drupal 9.3.22
  • Drupal 9.4.7
  • Drupal 9.5.9

Proposed resolution

As a result of this being caused by contrib or custom Views plugins, updates to the output of the offending Views plugin's defineOptions() functions should be made so that they follow the prescribed array structure instead of updating Drupal core.

Recommend changing issue status to Closed (won't fix).

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
PluginΒ  β†’

Last updated about 17 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States awm

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.69.0 2024