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

Bug with WPML and Use directory for default language #36

Closed
Ercogx opened this issue Jul 29, 2020 · 8 comments
Closed

Bug with WPML and Use directory for default language #36

Ercogx opened this issue Jul 29, 2020 · 8 comments
Milestone

Comments

@Ercogx
Copy link

Ercogx commented Jul 29, 2020

If I use WPML and have checked for "Use directory for default language" and I have the same links for the two languages, I have problem with Language switcher - it makes a link view "site.com/en/posts" "site.com//en/posts". It happens in function custom_permalinks_trailingslash

if ( trim( $_CPRegisteredURL, '/' ) == trim( $request, '/' ) ) {
      if ( isset( $url['path'] ) ) {
        return ( $string{0} == '/' ? '/' : '' ) . trailingslashit( $url['path'] ) . $_CPRegisteredURL;
      } else {
        return ( $string{0} == '/' ? '/' : '' ) . $_CPRegisteredURL;
      }
    }
@samiahmedsiddiqui
Copy link
Owner

samiahmedsiddiqui commented Jul 30, 2020

Hi @Ercogx

I think, this issue is already fixed. Can you please try this Alpha version.

If you have any development server then it will be really easy otherwise I recommend you to install this alpha version for the testing purpose only on production.

@Ercogx
Copy link
Author

Ercogx commented Jul 31, 2020

Cool it works, but unfortunately not for all cases. If on one page I use a normal slag not custom permalink and on another I use a custom permalink with the same link I will get the same bug)

@samiahmedsiddiqui
Copy link
Owner

samiahmedsiddiqui commented Jul 31, 2020

@Ercogx Do you have any development server?

@Ercogx
Copy link
Author

Ercogx commented Jul 31, 2020

So far, the site is only local, but I was able to reproduce the error on the test site

http://wp.little-about-web.top/en/test/

In the English version I do not use custom permalinks and just substitute the slag and in the Ukrainian version I use custom permalinks. If you want I can provide access to the admin panel.

@samiahmedsiddiqui
Copy link
Owner

samiahmedsiddiqui commented Aug 3, 2020

@Ercogx Please provide me the access on this email address. Also, please sent me the test link so I can quickly test the things.

@Ercogx
Copy link
Author

Ercogx commented Aug 3, 2020

@samiahmedsiddiqui sent email

@samiahmedsiddiqui
Copy link
Owner

samiahmedsiddiqui commented Aug 4, 2020

@Ercogx Issue fixed, please update to the beta version and test the issue again.

Let me know if it will not fixed for you.

@samiahmedsiddiqui samiahmedsiddiqui added this to the 1.6.0 milestone Aug 6, 2020
@samiahmedsiddiqui
Copy link
Owner

samiahmedsiddiqui commented Aug 8, 2020

@Ercogx Thank you so much for your support and testing the issues with me. I believe all your reported issues are sort out. I have officially released v1.6.0 that contains all your fixes.

Please feel free to open a new issue if you find any new issue.

Regards,
Sami

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

2 participants