Opened 22 months ago
Last modified 21 months ago
#57757 new defect (bug)
_get_block_templates_files fails when code is stored in map called templates
Reported by: | bastolen97 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Themes | Keywords: | has-patch |
Focuses: | Cc: |
Description
I was setting up a local template for a Bedrock repository in a folder called /Users/bas/git/work/templates/wp
, but because the path includes templates
FSE themes using a templates
folder instead of a block-templates
folder will not work. This has to do with the way the slug of the template is decided by cutting of all the text up until templates/
, but not checking if this text appears twice. By splitting the filename on this base_path
it will actually work.
My WPSE question from before solving the issue:
https://wordpress.stackexchange.com/questions/413959/full-site-editing-templates-folder-vs-block-templates
I have already fixed this issue in Github, will create a PR as soon as this is created.
Change History (2)
This ticket was mentioned in PR #4098 on WordPress/wordpress-develop by bastolen.
22 months ago
#1
- Keywords has-patch added
#2
@
21 months ago
- Version changed from trunk to 5.9
Hello @bastolen97,
Welcome to WordPress Core Trac!
I'm doing some triage for 6.2.0 (i.e. trunk
). The code in question was introduced in 5.9.0 via [52062] / #54335. So I'm changing the Version
from trunk
to 5.9.0
.
To help move progress forward, I'm wondering if this issue needs to be reported and resolved upstream in Gutenberg. Pinging @mamaduka for guidance.
The current way of loading in FSE theme template files may conflict when the WordPress installation is stored in a
templates
orblock-templates
folder. This PR fixes that constraint.Trac ticket: https://core.trac.wordpress.org/ticket/57757
WPSE Question: https://wordpress.stackexchange.com/questions/413959/full-site-editing-templates-folder-vs-block-templates (Made by me before finding the problem)