Opened 3 years ago
Last modified 21 months ago
#55691 reviewing defect (bug)
New site editor uses WP_SITEURL instead of WP_HOME
Reported by: | saijsaij | Owned by: | audrasjb |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Themes | Keywords: | needs-testing has-patch needs-testing-info reporter-feedback |
Focuses: | administration | Cc: |
Description
For my development environment I just installed a fresh copy of WordPress using Bedrock and Docker.
With this combination, my WP_HOME (http://wordpress.localhost) is different from my WP_SITEURL (http://wordpress.localhost/wp).
When I want to run the new Editor under "Appearance" I get the error message "The editor is unable to find a block template for the homepage."
Further debugging revealed, that the URL http://wordpress.localhost/wp/?_wp-find-template=true is requested which results in a 404 response.
For this setup, the URL http://wordpress.localhost/?_wp-find-template=true should be called instead as the whole site is reached under the URL http://wordpress.localhost and therefore can supply the requested information.
Change History (21)
#3
@
3 years ago
- Milestone changed from Awaiting Review to 5.9.4
- Version changed from 5.9.3 to 5.9
Milestoning for 5.9.4 for visibility.
#4
@
2 years ago
- Milestone changed from 5.9.4 to 6.1
Moving this ticket to next major release since it wasn't addressed during this cycle. Anyone is welcome to move it back to 6.0.x minor releases cycle if a patch is ready to ship.
This ticket was mentioned in PR #2713 on WordPress/wordpress-develop by rolf-yoast.
2 years ago
#7
- Keywords has-patch added; needs-patch removed
Replace site_url with home_url so that the editor can find the templates
Trac ticket: https://core.trac.wordpress.org/ticket/55691
This ticket was mentioned in PR #2717 on WordPress/wordpress-develop by enricobattocchi.
2 years ago
#8
Prevents a fatal error when you to access the site editor in a WP installation where the home URL is different than the site URL.
Trac ticket: https://core.trac.wordpress.org/ticket/55691
#9
@
2 years ago
- Summary changed from New theme editor uses WP_SITEURL instead of WP_HOME to New site editor uses WP_SITEURL instead of WP_HOME
#10
@
2 years ago
- Milestone changed from 6.1 to 6.2
With WP 6.1 RC 1 scheduled tomorrow (Oct 10, 2022), there is not much time left to address this ticket. Let's move it to the next milestone.
Ps: if you were about to send a patch and if you feel it is realistic to commit it in the next few hours, please feel free to move this ticket back to milestone 6.1.
This ticket was mentioned in Slack in #core-test by robinwpdeveloper. View the logs.
21 months ago
This ticket was mentioned in Slack in #core by costdev. View the logs.
21 months ago
@audrasjb commented on PR #2713:
21 months ago
#16
conflicts resolved
#17
@
21 months ago
- Owner set to audrasjb
- Status changed from new to reviewing
Self assigning for final review.
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
21 months ago
#19
@
21 months ago
- Keywords reporter-feedback added
Hi, I tried to reproduce the issue by moving WordPress to a sub folder, and I wasn't able to get any error when navigating to the site editor.
@saijsaij are you still able to replicate the issue using WP 6.2 beta 3?
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
21 months ago
#21
@
21 months ago
- Milestone changed from 6.2 to Awaiting Review
Moving this ticket back to Awaiting Review
. Why?
- @audrasjb wasn't able to reproduce the issue.
- Needs
reporter-feedback
. - No commits have been made yet.
Once it's able to be reproduced, then it can be moved into a milestone for resolution.
Tried some things more.
In the file wp-admin/site-editor.php on line 54 I changed the site URL to the home URL and it works.
Old:
$custom_settings = array( 'siteUrl' => site_url(), 'postsPerPage' => get_option( 'posts_per_page' ), 'styles' => get_block_editor_theme_styles(), 'defaultTemplateTypes' => $indexed_template_types, 'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(), '__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(), '__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(), );
New:
$custom_settings = array( 'siteUrl' => home_url(), 'postsPerPage' => get_option( 'posts_per_page' ), 'styles' => get_block_editor_theme_styles(), 'defaultTemplateTypes' => $indexed_template_types, 'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(), '__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(), '__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(), );
And least now I can see the editor. Other side effects I didn't see right now.