PHP 8 bug in og_ui_menu

Created on 19 December 2024, 3 days ago

Problem/Motivation

A bad argument is sent to field_ui_menu_load by og_ui_menu(). This results in a 404 when trying to delete an OG field from a bundle.

Steps to reproduce

Try to delete an OG from a bundle by visiting "admin/config/group/fields/%/%/%field_ui_menu/delete" when running PHP 8.2.

Proposed resolution

  $items['admin/config/group/fields/%/%/%field_ui_menu/delete'] = array(
    ...snip...
    'load arguments' => array(4, 5, 5, '%map'),

load arguments should be:

array(4, 5, '5', '%map'),

The original code worked "accidentally" in PHP 7 and earlier. The bundle name, rather then its position was sent to Field UI.

function field_ui_menu_load($field_name, $entity_type, $bundle_name, $bundle_pos, $map) {
  if ($bundle_pos > 0) {

"$bundle_pos > 0" is FALSE in PHP 7 and TRUE in PHP 8 when the bundle name is erroneously sent by og_ui to field ui.

🐛 Bug report
Status

Active

Version

2.11

Component

og-ui

Created by

🇺🇸United States kjl

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

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

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024