grappler / polylang-slug

A unique post slug within the language in Polylang. This allows for a page to have same/identical slug in multiple languages.
268 stars 84 forks source link

Polylang-slug sometime loaded after polylang #35

Closed idflood closed 6 years ago

idflood commented 7 years ago

On some recent website an update of wordpress broke the module. The error message from polylang_slug_admin_notices was shown despite having both wordpress and polylang updated.

It turns out polylang was only loaded after polylang-slug, so the POLYLANG_VERSION constant was not declared yet the whole plugin was not working.

To fix it I manually changed the order of plugins in the table wp_option. There is a active_plugins option_name which list all enabled plugins and are loaded in this order.

The best solution would be to do this version check in the plugins_loaded hook.

Eventually since not only the error message was shown but the whole plugin didn't work maybe we would need to rely on this "hack" https://snippets.khromov.se/modify-wordpress-plugin-load-order/

Chouby commented 7 years ago

That should not happen as Polylang should be the first plugin loaded. Adding some compatibility with WP 4.7 makes me introduce this bug with https://github.com/polylang/polylang/commit/3754c70986d136e602f4e5dff309ba37c073d18d I will fix that in the next version.

grappler commented 7 years ago

@Chouby I have not had time to test it. This can be fixed on your end?

Chouby commented 7 years ago

Sure. It will be fixed in the next version. I reverted the faulty commit and found another fix for the compatibility with WP 4.7.

grappler commented 7 years ago

@idflood Can you confirm the issue is fixed in Polylang 2.0.12?