Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#57974 closed defect (bug) (duplicate)

PHP 8.2 Warning preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated nav-menus.php

Reported by: ipajen's profile ipajen Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Menus Keywords: php81
Focuses: Cc:

Description (last modified by costdev)

Bug Report

Description

When using a theme that use /wp-admin/nav-menus.php following PHP warning is given:


preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

	
wp-admin/includes/plugin.php:2088
preg_replace()
wp-admin/includes/plugin.php:2088
get_plugin_page_hookname()
wp-admin/includes/plugin.php:2052
get_plugin_page_hook()
wp-admin/includes/plugin.php:1976
get_admin_page_title()
wp-admin/admin-header.php:35

Environment

  • WordPress: 6.2-RC3
  • PHP: 8.2.0
  • Server: Apache/2.4.54 (Win64) OpenSSL/1.1.1p PHP/8.2.0
  • Database: mysqli (Server: 10.4.27-MariaDB / Client: mysqlnd 8.2.0)
  • Browser: Edge 111.0.1661.44 (Windows 10/11)
  • Theme: GeneratePress 3.3.0
  • MU-Plugins:
    • WordPress automation by Installatron
  • Plugins:
    • Git Updater 12.1.3
    • Plugin Compatibility Checker 1.9
    • Plugin Dependencies 1.7.8
    • Query Monitor 3.12.0
    • Restaurant Menu 2.4.2
    • WordPress Beta Tester 3.3.5

Steps to Reproduce

  1. Enable DEBUG
  2. Use a theme that use /wp-admin/nav-menus.php and go there.
  3. Bug occurs.

Expected Results

  1. No PHP warning.

Actual Results

  1. PHP warning is shown.

Note:
Ticket at Generatepress theme: https://generatepress.com/forums/topic/php-8-1-deprecated-warning-preg_replace/

Tried "Twenty Twenty-Three Version: 1.1" but it gives "with Your theme does not support navigation menus or widgets."

Change History (1)

#1 @costdev
21 months ago

  • Component changed from General to Menus
  • Description modified (diff)
  • Keywords php81 added; PHP82 removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @ipajen, thanks for opening this ticket.

This has been fixed in #57918 and has been milestoned for 6.2.1.

Last edited 21 months ago by costdev (previous) (diff)
Note: See TracTickets for help on using tickets.