-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save navigation not working when site is not in domain root #25181
Comments
Just noting there were some comments on this in a triage session in slack (https://wordpress.slack.com/archives/C02RQBWTW/p1599638472256400). @draganescu mentioned the URL needs to take into account the I also mentioned that there's some apiFetch middleware that might be responsible for handling this for other requests (like REST API requests): Potentially that middleware also needs to also take into account this URL's path |
Probably we just need to include this bit of code in The difficulty is in setting up a test environment for this case 🙂 |
I verified that this is still an issue, if folks have a PR I can help test. One thing that stands out is that we're likely missing other fetch-api middleware / default scripts in the navigation page context. It'd be worth auditing what the edit-post context gets in comparison with this page. |
I checked in on this one and couldn't reproduce. It looks like the root middleware is now enqueued on the navigation page. Going to close this one out. @tellthemachines please reopen if you're still seeing this. |
It seems like this is still a bug as discussed in slack, so reopening: I think the middleware works for REST API requests, but doesn't work for the Customize ajax request that's being used temporarily by the screen to save menu items. |
To add details to the issue:
When clicking on the
With body:
The response is a 404 error. |
Describe the bug
A clear and concise description of what the bug is.
When trying to "Save navigation" in the navigation screen on my live website, a message pops up saying "There was an error" and the navigation isn't saved.
In the Network tab I can see that the POST request for saving the nav is using an incorrect URL. My website is not in the domain root but in a folder, like
mydomain.com/wp-website
, but the POST URL assumes it's in the root, so it's structured like:mydomain.com/wp-admin/admin-ajax.php?_locale=user
The issue seems to be with this line
To reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Expected to be able to save the nav no matter what my URL structure is like.
Screenshots
If applicable, add screenshots to help explain your problem.
Editor version (please complete the following information):
The text was updated successfully, but these errors were encountered: