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

WP-CLI: wp search-replace not working when plugin active #901

Open
chrilleferna opened this issue Oct 7, 2020 · 2 comments
Open

WP-CLI: wp search-replace not working when plugin active #901

chrilleferna opened this issue Oct 7, 2020 · 2 comments
Labels
core Core functionalities, including the admin section

Comments

@chrilleferna
Copy link

I use a script to replace URL:s when copying my database from development to staging and production. The script does a "wp search replace" and works fine when qtranslate-xt is deactivated but does not work when the plugin is active.

There is a warning when the plugin is active:
Notice: Undefined index: wp-path in .../wp-content/plugins/qtranslate-xt-master/qtranslate_core.php on line 445

I just tried to blindly remove that line from the condition - without really knowing what I did :-). The warning disappears, but the problem remains, so that is not a solution.

This could be related to the issue #766 (just an idea).

@chrilleferna
Copy link
Author

More info: In fact I think the problem HAS to do with the stuff around line 445, since there you check if there is a language indicator in the URL. I changed the language settings for the plugin and ticked the "Hide URL language info for default language", and with that things work as they should! So I guess it has something to do with language info (of course) not being passed when using WP-CLI.

@herrvigg herrvigg added the core Core functionalities, including the admin section label Oct 7, 2020
@herrvigg
Copy link
Collaborator

herrvigg commented Oct 7, 2020

Hey, many thanks for these investigations, this can be very useful to understand the problem! I must say i dislike url_info quite a lot, it's been a source of many problems. I'm refactoring code around it to make it simpler but there is still a lot to do.
It is very likely related to #766 but i'll try to give a look soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionalities, including the admin section
Projects
None yet
Development

No branches or pull requests

2 participants