Flexible layout used as a node display (via display suite) gives a PHP error with PHP8.0

Created on 19 September 2022, over 2 years ago
Updated 28 January 2023, almost 2 years ago

Problem/Motivation

There are at least two PHP errors with PHP8.0:

Error: Attempt to modify property "did" on string in panels_flexible_create_renderer() (line 294 of ./panels/plugins/layouts/flexible/flexible.inc).

Error: Attempt to assign property "add_css" on string in theme_panels_flexible() (line 400 of ./panels/plugins/layouts/flexible/flexible.inc).

In PHP7.4 the error is not fatal and a bit different:

Warning: Creating default object from empty value in panels_flexible_create_renderer() (line 294 of ./panels/plugins/layouts/flexible/flexible.inc).

Steps to reproduce

Set a flexible layout as a node display. In this case, the $display variable is an empty string causing a PHP error with PHP8.0 because technically layout is not attached to a panels display

Proposed resolution

$display/$handler could be empty when a layout in being used directly from DS, so account or that

Remaining tasks

Provide a patch

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Plugins - layouts

Created by

πŸ‡ΊπŸ‡¦Ukraine Taran2L Lviv

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