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

Language Switching Buttons missing in ACF options #1233

Closed
schalkjoubert opened this issue Oct 12, 2022 · 9 comments
Closed

Language Switching Buttons missing in ACF options #1233

schalkjoubert opened this issue Oct 12, 2022 · 9 comments
Labels
module: ACF Integration with ACF severity: major Major functionality

Comments

@schalkjoubert
Copy link

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 herrvigg added the module: ACF Integration with ACF label Oct 18, 2022
@herrvigg
Copy link
Collaborator

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
Copy link
Author

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')) ) :
?>

@schalkjoubert
Copy link
Author

WP Dash Screenshot
acf-domain

@herrvigg
Copy link
Collaborator

herrvigg commented Nov 5, 2022

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
Copy link
Collaborator

herrvigg commented Nov 5, 2022

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 herrvigg mentioned this issue Nov 5, 2022
herrvigg added a commit that referenced this issue Nov 13, 2022
A regression was introduced in 3.12.1, because the ACF admin was
setting its `qtranslate_admin_config` hook too late. That filter
must be set before action  `qtranslate_init_language` but it can't
be done with `plugins_loaded`.
This patch restores this hook earlier when the module is loaded,
by calling `qtranxf_acf_init` to do the full init at that time.
The loading sequence will be revisited for all modules.
@herrvigg herrvigg changed the title Editor Mode Langiage Switching Buttons missing Language Switching Buttons missing in ACF options Nov 13, 2022
@herrvigg
Copy link
Collaborator

@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
Copy link

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
Copy link
Collaborator

herrvigg commented Nov 19, 2022

Strange indeed, but the fix from 7a660fe 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
Copy link
Collaborator

Many ACF fixes released in 3.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: ACF Integration with ACF severity: major Major functionality
Projects
None yet
Development

No branches or pull requests

3 participants