Skip to content
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

Wrong redirection for taxonomy with edited slug #39

Open
imeto opened this issue Jan 1, 2020 · 0 comments
Open

Wrong redirection for taxonomy with edited slug #39

imeto opened this issue Jan 1, 2020 · 0 comments

Comments

@imeto
Copy link

imeto commented Jan 1, 2020

First, thank you for this plugin! I haven't used it yet, but my tests ran OK - almost everything seems to work, except one (very) special case:
The plugin created a wrong redirect for edited custom taxonomy slug (SLUG: from "globally2-edited" to "globally2-edited2"):

  • plugin created redirect from /permalinks1/permalinks1/gg/globally2-edited to /permalinks1/gg/globally2-edited2

The wrong thing is the doubled "/permalinks1/permalinks1" in the URL_FROM. (I'll describe where it comes from below...)

I checked the same for Post types and it works fine there (quite unexpected to me, but it's good news)!!

Now, here is my setup WP installation:

  • I'm using WP Multisite installation with sites in a directory (not on subdomain).
  • I created /permalinks1 - a new Site from the same multisite network
  • I used PODS to create a CPT and a custom taxonomy and I tested the URLs for default WP "post" type and my CPT type "blog". Then I added custom taxonomy for both: "global-tag".
  • I enabled the Permalinks Customizer plugin for this particular site (NOT network enabled!) and set some URLs in the settings: gg/%slug% (for taxonomy) and "post-type-url/%postname%" (for "post" type).
  • I created: a new "post", a new "blog" post. Then added a new "global-tag".
  • Now it was time to test the auto-redirection functionality of the plugin, by editing the custom taxonomy slug. When I edited an existing global-tag slug, the plugin created automatic redirect:
    /permalinks1/gg/globally2-edited | /gg/globally2-edited2
    However, the redirect wasn't working and I noticed that the URL_FROM was shown as "/permalinks1/gg/globally2-edited", but it was linked as "EXAMPLE.COM/permalinks1/permalinks1/gg/globally2-edited", where the site directory "permalinks1" is added twice (doubled): /permalinks1/permalinks1/....
  • As I said, tested this on custom post type and it is working properly there!
  • Tested the same multiple times on custom taxonomy:
    -- from globally2-edited2 to /gg/globally2-edited3 - same bug
    -- from globally2-edited3 to /gg/globally2-edited4 - same bug

I hope that would be enough to catch the bug for taxonomy, especially because the same doesn't happen for post type.

I haven't tested the following setup, but it may have the same issue:

The DEV installation is still available, so if you have any questions, I could make few more tests, even using a patched code (I can replace some lines of code manually and test them).
And last - the WP version is 5.2.4, not yet updated to 5.3.2, but that shouldn't be an issue. Just check how "URL_FROM" is generated for taxonomies and why the directory-part is added twice, thus generating a wrong URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant