[wp-trac] [WordPress Trac] #59018: Blocks in child themes with folder names starting with the same as the parent cannot load assets in WP6.3
WordPress Trac
noreply at wordpress.org
Tue Aug 22 21:10:32 UTC 2023
#59018: Blocks in child themes with folder names starting with the same as the
parent cannot load assets in WP6.3
----------------------------------------------------+---------------------
Reporter: lgladdy | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.3.2
Component: Editor | Version: 6.3
Severity: major | Resolution:
Keywords: has-patch has-unit-tests needs-testing | Focuses:
----------------------------------------------------+---------------------
Comment (by masteradhoc):
Adding further testing instruction based on feedback of @audrasjb and
@azaozz
Setup of our site is as following:
- WordPress 6.2.2
- GeneratePress Theme (Slug: generatepress) see
https://wordpress.org/themes/generatepress/
- GeneratePress ChildTheme (Slug: generatepress_child) download from here:
https://docs.generatepress.com/article/using-child-theme/#installing-a
-child-theme
- ACF Pro
Now you'll add a block over ACFs PHP Method see
https://www.advancedcustomfields.com/resources/blocks/
In functions.php you'll call the block like this
{{{#!php
<?php
add_action( 'init', 'register_acf_blocks' );
function register_acf_blocks() {
register_block_type( __DIR__ . '/inc-child/blocks/demo-v2' );
}
}}}
In the respective folder you'll have a block.json that's setup like this:
https://www.advancedcustomfields.com/resources/acf-blocks-key-concepts/
{{{
{
"name": "acf/board-members",
"title": "Board Members",
"description": "Board Members",
"script": "file:./board-members.js",
"category": "formatting",
"icon": "admin-comments",
"keywords": ["home", "events"],
"supports": {
"anchor": true
},
"acf": {
"mode": "preview",
"renderTemplate": "board-members.php"
},
"align": "full"
}
}}}
After updating the WordPress Version to 6.3 we noticed that the path where
the js file is called is wrong.
{{{
WP 6.2.2: /generatepress_child/inc-child/blocks/slider-bottom/slider.js
WP 6.3 /generatepress/_child/inc-child/blocks/slider-bottom/slider.js
}}}
We renamed our child theme from generatepress_child to childthemetest and
the js was called correctly again.
Also if the above fixed is applied the file was called correctly.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59018#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list