PHP 8.0: Exposed filter group 'value' approach is now a bug.

Created on 25 October 2022, almost 2 years ago
Updated 10 November 2022, almost 2 years ago

Problem/Motivation

Though #2429331: Exposed filter bug: bad identifier β†’ attempts to address a different issue, it perfectly describes the bug:

Workbench_access_handler_filter_access actively trying to work against Views handler system by providing an option named 'access_id' instead of the 'value' element that is hardcoded in a bunch of place in views_handler_filter.

Up until we had PHP 8.0 this worked more or less ok - Views would attempt to look up $row['value']'s children, and PHP would simply yield a warning message when a call to element_children($row['value']) would try to count NULL value (since $row['value'] is not even set).

With PHP 8.0 this now throws TypeError, making it impossible to configure the exposed form. See Changelog section on PHP: count - Manual.

Steps to reproduce

  • Have you site running on at least PHP 8.0,
  • Create a view, add exposed Workbench Access filter to it, and attempt to configure filter type - single or grouped,
  • The view will throw an Ajax error.
  • Switching back to PHP 7.x - exposed filter config form should work as expected.

Proposed resolution

Chang back to use the standard 'value' name.

Maybe it makes sense to reopen #2429331: Exposed filter bug: bad identifier β†’ and provide a better upgrade path - like using hook_update_N along with checking for views provided through code and letting code maintainers know what needs to be updated?

Upgrade path

From the related ticket:

Views created with version before 7.x-1.6 will need to be resaved. Another thing to note is that this now use Views standard rendering pipeline for the 'value' element, so to get back a multiple select, the user needs to check the "Allow multiple values" checkbox.

πŸ› Bug report
Status

Active

Version

1.6

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States euk

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

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