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
553 stars 104 forks source link

Language Switching Buttons missing in ACF options #1233

Closed schalkjoubert closed 1 year ago

schalkjoubert commented 1 year ago

Since version 3.12.1, the language Switching buttons are missing, even though that is selected under Editor Mode Instead the Simple Language Mode is used.

If I revert back to 3.12.0, the buttons show, but then the front en display both language with theur tags, ie.

:en]The family’s philosophy is structured around a simple principle: selecting the best terroir and partners: Sancerre and Provence in France, Stellenbosch in South Africa and Sicily in Italy, relying on local expertise in each of these estates.[:]

This only happens for custom fields on Options Pages. Standard wordpress Pages and Post do however display the buttons.

Please see screenshots attached, Thank you qtranslate Domains_–_Oddo_Vins___Domaines

herrvigg commented 1 year ago

This only happens for custom fields on Options Pages.

What do you mean with Option Pages, which one? How did you configure the Field Group to be active on such pages?

As a side note - with ACF 6 there's a brand new UI and I can't find the language buttons for the Field Group Title for example, this seems broken... But it's another problem, better create separate issues.

image

schalkjoubert commented 1 year ago

I created an Option page for each of my main "Features", and then in ACF set the Rule to Options. I prefer to work this way to simplify he UI for the client. They don't have to go to pages then. See attached screenshots.

`if( function_exists('acf_add_options_page') ) { acf_add_options_page(array( 'page_title' => 'Domain', 'menu_title' => 'Domain', 'menu_slug' => 'tsum-domain', 'capability' => 'edit_posts', 'redirect' => false, 'icon_url' => 'dashicons-awards', // 'position' => 2, )); }

add_action( 'storefront_before_content', 'tsum_before_content_domain_header', 1 ); function tsum_before_content_domain_header () { if( is_page(array('domains','domaines')) ) : ?>

<?php endif; }`

schalkjoubert commented 1 year ago

WP Dash Screenshot acf-domain

herrvigg commented 1 year ago

The options page are only available in the PRO version that I don't have 😕 https://www.advancedcustomfields.com/add-ons/options-page/ There used to be a free addon plugin just for the options page... but obviously they have removed it - how annoying 😞
Ideally I should have a copy of ACF PRO for debugging, But can't this addon plugin be retrieved somewhere?

herrvigg commented 1 year ago

Since version 3.12.1, the language Switching buttons are missing, even though that is selected under Editor Mode Instead the Simple Language Mode is used. If I revert back to 3.12.0, the buttons show, but then the front en display both language with theur tags

Between 3.12.0 and 3.1.22.1 I refactored the ACF structure in #1191 but it was supposed to maintain all the existing functionalities. What is surprising is that you also had issues in 3.12.0. Has this page already worked before?

@ChristophJeworutzki do you observe the same problem? Did it work with 3.12.0, and if not, did it work before?

herrvigg commented 1 year ago

@schalkjoubert @ChristophJeworutzki I found the problem with the LSB in ACF options page, it was a regression in 3.12.1 with the init sequence, now fixed in master. I don't know about the problem on the front-end with the tags, I expect it to work normally. Could you test the current version on master?

Note there's a known problem with ACF 6 for the field group name but that's another topic, see #1227.

MKRD-SUPPORT commented 1 year ago

Strange, why is this working for me?

WP 6.1.1 (Twenty Twenty-One) ACF PRO 6.0.4 / 6.0.5 (Option page) QTX 3.12.1

Edge, Firefox

herrvigg commented 1 year ago

Strange indeed, but the fix from 7a660fe6bd1fefd83b858a1c506618639e08006a is needed. Before that, the QTX_Module_Acf_Admin would be initialized too late on plugins_loaded priority 3. It sets a qtranslate_admin_config filter but this is needed in qtranslate_init_language called first on plugins_loaded priority 2 and the result is cached in a static variable... This init sequence is quite tricky. If it works without that fix there must be something else that changes that regular scenario.

herrvigg commented 1 year ago

Many ACF fixes released in 3.13.0.