PHP 8.1 compatibility: passing null to explode() in page_manager_page_get_named_arguments() is deprecated

Created on 14 August 2023, over 1 year ago
Updated 15 February 2024, 9 months ago

Problem/Motivation

While creation of the new page I faced the next error:
Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in page_manager_page_get_named_arguments() (line 501 in /ctools/page_manager/plugins/tasks/page.inc).
The reason is that on the very first step of page creation $page->path is not set yet. This causes the warning as PHP8.1 doesn't likes null as an argument of explode().

Steps to reproduce

1. Go to admin/structure/page
2. Click 'Add custom page'
3. Observe a warning message.

Proposed resolution

I suggest not to execute page_manager_page_get_named_arguments() if path is not set.

πŸ› Bug report
Status

RTBC

Version

1.0

Component

Page Manager

Created by

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

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

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024