qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
554 stars 105 forks source link

No language buttons with WordPress 4 #825

Closed jurgen-74 closed 4 years ago

jurgen-74 commented 4 years ago

I've installed version 3.8.0 and everything seemed to work just fine untill I wanted to write a new post. I cannot choose the language and only see the html tab (cannot switch to visual). WordPress 4.9.8

Anyone else with the same problem?

Blessings, Jurgen installed-plugins.txt

jurgen-74 commented 4 years ago

oh, wait! Can it be that this version will only work properly on WP5.4 with classic editor installed. I tried it in virtualbox with a test wp. There it works just fine. My actual website is on wordpress 4.9.8 and only the provider can update that one.

Am I right or am I still missing something.

Jurgen

herrvigg commented 4 years ago

It is still supposed to work with WP 4.8+ but i must admit i didn't try it recently with WP < 5.0. In that case you don't even need the Classic Editor unless you install Gutenberg.

But i just realized there might be a problem here: https://github.com/qtranslate/qtranslate-xt/blob/2f3191bf819950a0dd5c6deaa3484bae1703e675/admin/qtx_admin.php#L442-L443

This function is_block_editor() was added in 5.0 so with WP 4.9.8 you should see a very clear error on this. Maybe you have disabled some error propagation.

Anyway, can you try changing the if-test to this? if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() )

This should solve the problem. Let me know.

jurgen-74 commented 4 years ago

Are you smart or what! That did the trick. Of course I've no idea whether that is an aprovement or not for the plugin but at least it works on WP 4.9.8 now.

herrvigg commented 4 years ago

The fix is now in master, it will be released in 3.8.1.

pjrobertson commented 4 years ago

I literally just came across this bug and was about to submit a PR to fix it. Thanks!

Looking forward to 3.8.1 :)

jurgen-74 commented 4 years ago

Yeah, this is what I love about opensource. There are always people who can help or contribute.