[wp-trac] [WordPress Trac] #62755: Allow template duplication + concept of active templates
WordPress Trac
noreply at wordpress.org
Wed Oct 22 03:19:42 UTC 2025
#62755: Allow template duplication + concept of active templates
-----------------------------+-----------------------
Reporter: ellatrix | Owner: ellatrix
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.9
Component: Editor | Version: trunk
Severity: normal | Resolution:
Keywords: gutenberg-merge | Focuses:
-----------------------------+-----------------------
Changes (by dd32):
* status: closed => reopened
* resolution: fixed =>
Comment:
Hey @ellatrix,
This has started to produce some PHP Warnings on WordPress.org with the
https://github.com/wordpress/wporg-main-2022/ theme.
I'm unsure if the theme does something wrong, or if it's related to this
change.
It appears to be related to a 404 condition not setting the templates
correctly.
Eg: https://wordpress.org/download/?author=1
{{{
E_WARNING: Undefined array key "page-download" in wp-includes/block-
template.php:246
}}}
Debug on line 242 of [61029] with `print_r( compact ( 'slug_priorities',
'templates' ) );` reveals:
{{{
Array
(
[slug_priorities] => Array
(
[404] => 0
)
[templates] => Array
(
[0] => WP_Block_Template Object
(
[type] => wp_template
[theme] => wporg-main-2022
[slug] => 404
[id] => wporg-main-2022//404
....
)
[1] => WP_Block_Template Object
(
[type] => wp_template
[theme] => wporg-main-2022
[slug] => page-download
[id] => wporg-main-2022//page-download
......
)
)
)
}}}
Prior to [61029] it's this:
{{{
Array
(
[slug_priorities] => Array
(
[404] => 0
)
[templates] => Array
(
[0] => WP_Block_Template Object
(
[type] => wp_template
[theme] => wporg-main-2022
[slug] => 404
[id] => wporg-main-2022//404
....
)
)
)
}}}
Also appears to affect this theme, which I'm assuming is because the URL
is a 404 unless logged in.
{{{
https://github.com/WordPress/wporg-showcase-2022
URL (logged out) https://wordpress.org/showcase/submit-a-wordpress-site/
E_WARNING: Undefined array key "page-submit" in wp-includes/block-
template.php:246
}}}
Hopefully that's enough information to reproduce and fix?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62755#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list