Closed mikehues closed 2 months ago
Hi @mikehues
Sorry for facing this issue. Can you please check whether this is still an issue for you or already fixed in the new version. I am not able to generate it in the new version. If you are still able to generate this issue then please let me know.
Thanks, Sami
Hi Sami,
Sorry it took so long for me to reply. Looks like the issue is partly resolved with the new version.
updated versions: Wordpress 5.8 Twenty Twenty One 1.4 Custom Permalinks 2.0.1
When I update the custom permalink, there is no longer an error in the console. Also, the 'View Page' button link in the Custom Permalinks metabox is updated correctly. But, the view page links in the top admin bar and the bottom popup still point to the previous permalink. After playing around for a bit, here are some observations I've made.
My expectations are based on the wordpress core behavior, which is as follows:
Here's a simple example which has unexpected, but acceptable results. (This wouldn't technically require the Custom Permalinks plugin, since there is no directory structure in this url.)
So, I don't get a 'page not found', when clicking the view page links, which is good. But, the redirect was unexpected.
Here's where I start to run into trouble:
Here's another example with a directory structure:
So, now the page is available at two different urls, which is unexpected and not ideal.
Please let me know if I can provide anymore info.
thanks,
Mike
@mikehues Thank you for detailed reply.
Here's another example with a directory structure:
- I goto example.local/womens/place and I change the permalink to example.local/womens/test
- I click one of the links that still points to example.local/womens/place and the page loads at the old permalink
- if I goto the new permalink (example.local/womens/test) the page loads successfully.
In this case, old permalink should redirect to the new permalink instead of serving the page. (I will check if I am able to re-produce this issue on my end).
@mikehues I have released v2.2.0
that fixes couple of issues you have pointed. Can you please test your pointed issues with the v2.2.0
?
Hi Sami,
thanks for your work on this.
I just ran the same tests with version 2.2.0
I can confirm that, upon updating the permalink, all three 'View Page' links are updated to the new permalink. So, this has fixed the issue of clicking 'view page' and getting 'page not found' or seeing the page at the old permalink. But, if I manually type in the old permalink, the page loads successfully at that url instead of redirecting to the new url.
thanks,
Mike
But, if I manually type in the old permalink, the page loads successfully at that url instead of redirecting to the new url.
@mikehues old permalink means old customized permalink or WP permalink? Also, can you please test this after deactivating all the other plugins and switching to the default theme?
If you still able to crawl the old permalink then please provide me an example.
In actual, old customized permalink should not work and throws 404. Redirect needs to be manually added or wait for the next release in which I will add redirect functionality as well.
Hi Sami,
I did test with all other plugins disabled and using twentytwentyone theme. Old customized permalinks throw 404s as expected, but the original WP permalink still loads
I repeated this test with a directory structure:
thanks,
Mike
Wordpress 5.7.2 Twenty Twenty-One 1.3 Custom Permalinks 1.7.1
I disabled all other plugins and created a new page. I edit the page and make a simple text change and click 'Update'. Shortly after the "Page update. View Page" message pops up at the bottom of the page, this error shows up in the console:
GET https://testsite.local//wp-json/custom-permalinks/v1/get-permalink/4556 401 (Unauthorized). script-form-1.7.1.min.js?ver=5.7.2:1 updateMetaBox | @ | script-form-1.7.1.min.js?ver=5.7.2:1 (anonymous) | @ | data.min.js?ver=9430…126df689839bb96b9:2 i | @ | data.min.js?ver=9430…126df689839bb96b9:2 . . .
The changes to the page content are successfully saved, so it doesn't pose much of a problem until you try to update the permalink. If you change the permalink and click 'Update', the same thing happens. But now, the 'View Page' links still point to the old permalink. If you click any of these links (top admin bar, Custom permalink metabox button & lower left 'page updated' popup) you get a page not found.
Please let me know if you need additional info.
thanks,
Mike