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
550 stars 103 forks source link

Issue with plugin Metaslider after updating to WP 6.1 #1247

Closed bagaweb closed 1 year ago

bagaweb commented 1 year ago

Do not know if this issue is related to qTranslate-XT or the Metaslider plugin... anyway:

With WordPress 6.0.3 I was simply inserting these captions "[:en]English caption[:it]Italian caption" in the slider settings and it was working as expected, "English caption" was shown on the English version and "Italian caption" on the Italian version.

After updating to WordPress 6.1, captions are showing up like this even on front-end, "[:en]English caption[:it]Italian caption" on both English and Italian versions.

vonsch76 commented 1 year ago

Edit inc/slide/metaslide.image.class.php

search for `//add caption

   if (strlen($slide['caption'])) {
        $html .= '<div class="caption-wrap"><div class="caption">' . $tst2. $slide['caption'] . '</div></div>';
    }`

change like this

`//add caption

    if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) $slide['caption']=qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($slide['caption']);
    if (strlen($slide['caption'])) {
        $html .= '<div class="caption-wrap"><div class="caption">' . $tst2. $slide['caption'] . '</div></div>';
    }`
bagaweb commented 1 year ago

Thanks a lot for you help @vonsch76 ! Your solution works.

Is the issue related to Metaslider plugin or WordPress 6.1. itself? I suppose I should change those lines everytime Metaslider receives an update. Maybe is there a way to add some lines to functions.php file inside the theme?

vonsch76 commented 1 year ago

Haven't really checked in details, but Metaslider would need to have a filter for that. At the moment there is no such. Also the issue would not exists if Metaslider would get the caption with a function like get_post().

bagaweb commented 1 year ago

Do you think we should point this issue to Metaslider authors?

vonsch76 commented 1 year ago

Yes, I believe adding filters would be a valuable add-on.

bagaweb commented 1 year ago

What should I exactly ask?

vonsch76 commented 1 year ago

Either a filter before caption is put out or some other method to get the caption like get_post where the filtest are ran.

On Mon, 14 Nov 2022 at 16:10, bagaweb @.***> wrote:

What should I exactly ask?

— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1247#issuecomment-1313904405, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXKJAJLCA2VJHM25QXAOHTWIJI6RANCNFSM6AAAAAARZI7EUA . You are receiving this because you were mentioned.Message ID: @.***>

vonsch76 commented 1 year ago

Seems that something has changed in Metaslider and it works now without extra code changes. Still testing, though.

bagaweb commented 1 year ago

I can read this on their changelog:

FIXED: Fix compatibility with plugin qTranslate-XT, #294;

But I can still see the same issue... What am I missing?

WordPress 6.1.1 qTranslate-XT 3.12.1 MetaSlider 3.28.2

Please have a look at campingmarmolada[dot]com

vonsch76 commented 1 year ago

The closing backet.

Looks like

[:it]La tua vacanza in Val di Fassa[:en]Your holiday in Val di Fassa[:de]Ihr Urlaub in Fassatal[:fr]Vos vacances en Val di Fassa

While it should look like

[:it]La tua vacanza in Val di Fassa[:en]Your holiday in Val di Fassa[:de]Ihr Urlaub in Fassatal[:fr]Vos vacances en Val di Fassa[:]

for all strings to allow qTranslate-xt to operate.

vonsch76 commented 1 year ago

check the wiki https://github.com/qtranslate/qtranslate-xt/wiki/Multilingual-fields

bagaweb commented 1 year ago

While it should look like

[:it]La tua vacanza in Val di Fassa[:en]Your holiday in Val di Fassa[:de]Ihr Urlaub in Fassatal[:fr]Vos vacances en Val di Fassa[:]

for all strings to allow qTranslate-xt to operate.

I tried to add the closing bracket and now it looks as it is, e.g. closing bracket appering at the end of the caption... Still not separating the languages.

vonsch76 commented 1 year ago

I have the same. Are the captions entered manually? Do you have any error codes?

vonsch76 commented 1 year ago

Here is the code on the metaslider

inc/slide/metaslide.image.class.php:662: $html .= '

' . apply_shortcodes($slide['caption']) . '
';

the same repeats about 100 lines later.

you can still inster the same

if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) $slide['caption']=qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($slide['caption']);

before the slide caption in the worst case scenario.

bagaweb commented 1 year ago

I have the same. Are the captions entered manually? Do you have any error codes?

Please have a look at the attache screenshot:

screenshot-www campingmarmolada com-2022 12 23-12_37_31

vonsch76 commented 1 year ago

Should see the server side what is happening. Obviously the filter is not running. Check if at qtranslate-xt setting in the advanced part the ml-slider and the ml-slide is checked.

bagaweb commented 1 year ago

Yes both ml-slide and ml-slider are checked in the advance settings of qtranslate-xt,

vonsch76 commented 1 year ago

Only you have access to the backend, start checking in the ml code why the filter is not called. Try to change, call the filter manually, etc. Manual labour as usual. Quoted where you should start. Others haven't reported, mine is different - as it works.

bagaweb commented 1 year ago

Yes I do have the access to the backend, how can I check this filter? Thanks for your help.

vonsch76 commented 1 year ago

You have the code, save the $html in a file before and after. This is kind of DIY work. I have installed the latest 3.28.3 and still seems fine. My WP is older though, I never install the newest in production environment.

bagaweb commented 1 year ago

Ok that might be the reason why it is working on your side! You older WP version. I started having this issue after updating to 6.1. Is there anyone here having my issue with WP 6.1, QTX 3.13.0 and MetaSlider 3.28.3?

bagaweb commented 1 year ago

MetaSlider has been updated to 3.29.0 and the issue with qTranslate-XT is still here.

vonsch76 commented 1 year ago

Works flawless for me. Upgraded only for your sake. As I told you earlier the issue is something local with your setup.

bagaweb commented 1 year ago

Did you also update WordPress to its last version or just the plugin?

vonsch76 commented 1 year ago

I never update to the latest WP, always behind with 1 major version.

bagaweb commented 1 year ago

That's why you don't see the error. I'd like to understand if the issue is related to QTX rather tham MetaSlider.

vonsch76 commented 1 year ago

Made a test with my other page. Newest WP 6.1.1, Metaslider 3.29.0 There is no error, qtranslate works as it should. Check for yourself https://portumlines.hu/en/metaslider-test/

bagaweb commented 1 year ago

Thanks for your feedback.

There must be some js and css loading errors on my side, please check this screenshot: screenshot-portumlines hu-2023 03 19-23_02_10

vonsch76 commented 1 year ago

Thanks for reminding me, I have checked without cache. Works now, you can see for yourself. When you click the flag, the legend under the picture will change as it should. Seems that the error is somewhere on your side, but you need to check the local logs to figure it out.

On Sun, 19 Mar 2023 at 23:07, bagaweb @.***> wrote:

Thanks for your feedback.

There must be some js and css loading errors on my side, please check this screenshot: [image: screenshot-portumlines hu-2023 03 19-23_02_10] https://user-images.githubusercontent.com/14122970/226212518-308e5a05-6344-4be2-b950-f0a71547c5f9.png

— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1247#issuecomment-1475413218, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXKJAMYSTIPCQAHTGEBTNLW457SBANCNFSM6AAAAAARZI7EUA . You are receiving this because you were mentioned.Message ID: @.***>

bagaweb commented 1 year ago

I have the same. Are the captions entered manually? Do you have any error codes?

Please have a look at the attache screenshot:

screenshot-www campingmarmolada com-2022 12 23-12_37_31

Thanks for your help @vonsch76

Do you have the same settings in your backend?

bagaweb commented 1 year ago

Anyway, on the troubleshooting section, there are these info:

{ "PHP_VERSION": "7.4.3", "WP_VERSION": "6.1.1", "QTX_VERSION": "3.13.0", "Plugins": [ "MetaSlider 3.29.1", "qTranslate-XT 3.13.0" ] }

bagaweb commented 1 year ago

{ "default_language": "it", "enabled_languages": [ "it", "en", "de", "fr" ], "flag_location": "plugins/qtranslate-xt/flags/", "language_name": { "it": "IT", "en": "EN", "de": "DE", "fr": "FR" }, "locale": { "it": "it_IT", "en": "en_US", "de": "de_DE", "fr": "fr_FR" }, "locale_html": { "it": "", "en": "", "de": "", "fr": "" }, "not_available": { "it": "Ci spiace, ma questo articolo è disponibile soltanto in %LANG:, : e %.", "en": "Sorry, this entry is only available in %LANG:, : and %.", "de": "Leider ist der Eintrag nur auf %LANG:, : und % verfügbar.", "fr": "Désolé, cet article est seulement disponible en %LANG:, : et %." }, "date_format": { "it": "%e %B %Y", "en": "%A %B %e%q, %Y", "de": "%A, \\d\\e\\r %e. %B %Y", "fr": "%A %e %B %Y" }, "time_format": { "it": "%H:%M", "en": "%I:%M %p", "de": "%H:%M", "fr": "%H:%M" }, "flag": { "it": "it.png", "en": "gb.png", "de": "de.png", "fr": "fr.png" }, "url_mode": 2, "use_strftime": 3, "filter_options_mode": 0, "language_name_case": 0, "detect_browser_language": true, "hide_untranslated": false, "show_menu_alternative_language": false, "show_displayed_language_prefix": true, "show_alternative_content": false, "hide_default_language": true, "use_secure_cookie": false, "header_css_on": false, "header_css": ".qtranxs_flag_it {background-image: url(https://www.campingmarmolada.com/wp-content/plugins/qtranslate-xt/flags/it.png); background-repeat: no-repeat;}\r\n.qtranxs_flag_en {background-image: url(https://www.campingmarmolada.com/wp-content/plugins/qtranslate-xt/flags/gb.png); background-repeat: no-repeat;}\r\n.qtranxs_flag_de {background-image: url(https://www.campingmarmolada.com/wp-content/plugins/qtranslate-xt/flags/de.png); background-repeat: no-repeat;}\r\n.qtranxs_flag_fr {background-image: url(https://www.campingmarmolada.com/wp-content/plugins/qtranslate-xt/flags/fr.png); background-repeat: no-repeat;}\r\n", "text_field_filters": [], "term_name": [], "disable_client_cookies": false, "ignore_file_types": [ "gif", "jpg", "jpeg", "png", "svg", "pdf", "swf", "tif", "rar", "zip", "7z", "mpg", "divx", "mpeg", "avi", "css", "js", "mp3", "mp4", "apk" ], "url_info": { "cookie_lang_front": "it", "cookie_lang_admin": "it", "cookie_front_or_admin_found": true, "scheme": "http", "host": "localhost", "path": "/campingmarmolada.com/wp-admin/admin-ajax.php", "query": "action=admin_debug_info", "path-base": "/campingmarmolada.com", "wp-path": "/wp-admin/admin-ajax.php", "language_neutral_path": true, "http_referer": "https://www.campingmarmolada.com/wp-admin/options-general.php?page=qtranslate-xt", "referer_admin": true, "doing_front_end": false, "lang_cookie_admin": "it", "lang_admin": "it", "language": "it", "set_cookie": false }, "language": "it", "editor_mode": 0, "highlight_mode": 1, "auto_update_mo": true, "hide_lsb_copy_content": false, "lsb_style": "Simple_Tabs.css", "config_files": [ "./i18n-config.json" ], "custom_i18n_config": [], "custom_fields": [], "custom_field_classes": [], "post_type_excluded": [], "admin_enabled_modules": { "slugs": true, "acf": false, "all-in-one-seo-pack": false, "events-made-easy": false, "jetpack": false, "google-site-kit": false, "gravity-forms": false, "woo-commerce": false, "wp-seo": false }, "translator": {}, "qtrans_compatibility": false }

vonsch76 commented 1 year ago

Yes, the same

[image: image.png]

As written, Metaslider, Wordpress the newest, PHP 8.1

On Tue, 21 Mar 2023 at 17:59, bagaweb @.***> wrote:

I have the same. Are the captions entered manually? Do you have any error codes?

Please have a look at the attache screenshot:

[image: screenshot-www campingmarmolada com-2022 12 23-12_37_31] https://user-images.githubusercontent.com/14122970/209330027-1e1c125d-f100-4d5d-8c9f-aeedbae612c9.png

Thanks for your help @vonsch76 https://github.com/vonsch76

Do you have the same settings in your backend?

— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1247#issuecomment-1478260389, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXKJAKIBHIL2NBEYMF5VIDW5HNA7ANCNFSM6AAAAAARZI7EUA . You are receiving this because you were mentioned.Message ID: @.***>

bagaweb commented 1 year ago

I should try to upgrade to PHP 8.1 and see what happens.

vonsch76 commented 1 year ago

Seen no effect on that. You have some other problem, as told you earlier. Try to switch off the other plugins.

On Tue, 21 Mar 2023 at 18:20, bagaweb @.***> wrote:

I should try to upgrade to PHP 8.1 and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1247#issuecomment-1478298729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXKJAMHN3SGY2I5JP4WUCDW5HPOHANCNFSM6AAAAAARZI7EUA . You are receiving this because you were mentioned.Message ID: @.***>

bagaweb commented 1 year ago

No other plugins are active.

vonsch76 commented 1 year ago

Check at advanced whether ml-slider and ml-slide is enabled for translation.

On Tue, 21 Mar 2023 at 18:26, bagaweb @.***> wrote:

No other plugins are active.

— Reply to this email directly, view it on GitHub https://github.com/qtranslate/qtranslate-xt/issues/1247#issuecomment-1478309176, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXKJAONMGV7E4KI4M2FVPDW5HQGDANCNFSM6AAAAAARZI7EUA . You are receiving this because you were mentioned.Message ID: @.***>

bagaweb commented 1 year ago

Check at advanced whether ml-slider and ml-slide is enabled for translation.

Yes that was already been checked. Will you be so kind to send me some screenshots or the troubleshooting export?

herrvigg commented 1 year ago

Can someone summarize the status of this ticket? From QTX 3.14.0 the debug information becomes more compact, to help reproducing the problems.

vonsch76 commented 1 year ago

Seems some isolated problem at @bagaweb with regard the translation of the language. Tried, but unable to reproduce, works fine on my end.

bagaweb commented 1 year ago

{ "PHP_VERSION": "7.4.3", "WP_VERSION": "6.2", "QTX_VERSION": "3.14.0", "Plugins": [ "MetaSlider 3.29.1", "qTranslate-XT 3.14.0" ] }

I can confirm with the latest updates the problem is finally solved!!! We can close this issue. Thank you