php 8.1 - Unparenthesized `a ? b : c ? d : e` is not supported.

Created on 11 August 2023, over 1 year ago
Updated 5 March 2024, 9 months ago

Problem/Motivation

encountering a fatal error when visiting a map:

Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /sites/all/modules/ip_geoloc/views/ip_geoloc_plugin_style.inc on line 466

Steps to reproduce

Use Drupal with php 8+
Load a map that utilizes the module functionality

Proposed resolution

adda parentheses to the offending line like this:
$items[0] = empty($differentiator_value) ? array() : (is_array($differentiator_value) ? $differentiator_value : array($differentiator_value));

🐛 Bug report
Status

Closed: duplicate

Version

1.30

Component

Code

Created by

🇸🇰Slovakia sano

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024