Problem/Motivation

Notice thrown when on PHP 7.4

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in sites/all/modules/ms_core/ms_core.forms.inc on line 1425

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Spokje created an issue. See original summary.

spokje’s picture

StatusFileSize
new681 bytes
tonka67’s picture

Patch applies clean and appears to have resolved the issue. Thanks!

fenstrat’s picture

Status: Needs review » Reviewed & tested by the community

Looks like the correct approach. #2 fixes static analysis:

The left-associativity of the ternary operator has been deprecated in PHP 7.4 and removed in PHP 8.0. Multiple consecutive ternaries detected. Use parenthesis to clarify the order in which the operations should be executed

fenstrat’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.31 KB
new1.58 KB

Actually a couple more nested ternaries needed adjusting. These things are a nightmare.