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

error during slugs uninstallation after successful migration #1184

Closed
Hr0bar opened this issue Jun 7, 2022 · 3 comments
Closed

error during slugs uninstallation after successful migration #1184

Hr0bar opened this issue Jun 7, 2022 · 3 comments

Comments

@Hr0bar
Copy link

Hr0bar commented Jun 7, 2022

Hi, experienced this error when pressing the uninstall button of qtranslate-slug and it did not uninstall:

AH01071: Got error 'PHP message: PHP Fatal error: Cannot redeclare qts_get_url() (previously declared in /opt/bitnami/wordpress/wp-content/plugins/qtranslate-xt/modules/slugs/src/slugs-utils.php:7) in /opt/bitnami/wordpress/wp-content/plugins/qtranslate-slug/qtranslate-slug.php on line 126', referer:

Not sure if solvable without renaming qts_get_url :/

@herrvigg
Copy link
Collaborator

herrvigg commented Jun 7, 2022

Yes it would clash when used at the same time. An easy workaround is to disable the Slugs module or the qTranslate-XT plugin before you uninstall QTS and enable all back after that. Be sure your migration is complete by checking the migrated slugs in post/pages (postmeta) and in the slugs settings (termmeta and options).

We should have renamed these functions, all qtranslate functions should at least be prefixed by qtranxf. That also applies to the other modules as ACF, WooCommerce... though in that case there's a plugin check because we know the plugin path of the default install.

But that's not the best way to do it, I'm thinking of introducing namespaces in the next major release (V4). WordPress is not showing the good example either, they have a bunch of global functions, just a few prefixed with wp_. They should use namespaces but they look quite stuck with their legacy API. I would be more radical, deprecate old stuff in a major release and give some time but force active plugins to change.

herrvigg added a commit that referenced this issue Jun 8, 2022
Function names with legacy `qts_` prefix create potential conflicts.
Adopt the `qtranxf_` prefix convention, declined as `qtranxf_slugs_`.
Rename some internal method in class QTX_slugs.
@herrvigg
Copy link
Collaborator

Fixed in master.

@herrvigg
Copy link
Collaborator

herrvigg commented Sep 4, 2022

Fix released in 3.12.1.

@herrvigg herrvigg closed this as completed Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants