[wp-trac] [WordPress Trac] #59723: Pattern file containing PHP constant from theme causes fatal error on update to WordPress 6.4

WordPress Trac noreply at wordpress.org
Tue Oct 24 23:03:58 UTC 2023


#59723: Pattern file containing PHP constant from theme causes fatal error on
update to WordPress 6.4
-----------------------------+------------------------
 Reporter:  fabiankaegy      |       Owner:  joemcgill
     Type:  defect (bug)     |      Status:  accepted
 Priority:  high             |   Milestone:  6.4
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------------

Comment (by pbiron):

 = Steps to reproduce

 1. start w/ a fresh site running 6.3.2
 2. install/activate the sample theme in comment:2
 3. update to 6.4-RC2 via WP_CLI, `wp core update --version=6.4-RC`
 4. check the PHP error logs, and notice `PHP Fatal error:  Uncaught Error:
 Undefined constant "NAMESPACE_IMAGE_URL" in path-to-site/wp-content/themes
 /wp-core-59723-sample-theme-main/patterns/sample.php:9`

 = Steps to test the [https://github.com/WordPress/wordpress-
 develop/pull/5568 PR]
 1. roll the site back to 6.3.2, `wp core update --version=6.3.2 --force`
    a. note: another error will be logged, you can ignore it the purposes
 of this testing
 2. update `wp-includes/block-patterns.php` in the WP_CLI ZIP file in
 `~/.wp-cli/cache/core/wordpress-6.4-RC2-en_US.zip` so that the PR has been
 applied (i.e., add the early return from
 `_register_theme_block_patterns()` if `wp_is_installing()` is true)
 3. clear your PHP error log file
 4. update to 6.4-RC2, `wp core update --version=6.4-RC2`
 5. check the PHP error logs and notice no error was logged

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59723#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list