Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are using WPML with ACF Options Page to display translated versions of your Options Page ACF fields. After updating Advanced Custom Fields Multilingual to version 2.1.4.2, the translated versions are not visible when not logged into the admin site. Specifically, header and footer links/page options remain in English instead of German when not logged in, but appear correctly when logged in as an Admin.
Solution:
We found that the issue is due to a specific code in your custom theme located at

wp-content/plugins/rmg-site-functionality/inc/ACF_Group.php

within the method

\RMG\Tolomatic\SiteFunctionality\ACF_Group::acf_init_settings_page

. This method includes a return "false" condition that prevents the ACF option names from populating properly unless the user is logged in. To resolve this, we recommend commenting out or refactoring this code. The

acf/init

hook used might be too early and unsuitable for this logic.

If this solution does not resolve your issue or seems outdated, please check for related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket at WPML support forum for further assistance.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 0 reply, has 2 voices.

Last updated by George Botsev 1 year ago.

Assisted by: Kor.

Author Posts
November 11, 2024 at 7:44 pm #16390068

tolomatic-inc.M

Background of the issue:
I am trying to use WPML with ACF Options Page to display translated versions of our Options Page ACF fields. With the recent update for Advanced Custom Fields Multilingual (2.1.4.2), we are no longer seeing the translated versions when not logged into the admin of the site. The issue can be seen on this page: hidden link.

Symptoms:
When not logged in, all header and footer links/page options are in English instead of German. When logged in as an Admin, the translations appear correctly.

Questions:
Why are the translated ACF Options Page fields not displaying when not logged in?
How can I ensure that the translations appear correctly for all users?
Attaching an "expected" screenshot. The main nav is not translated when logged in, which is another issue, but that has been going on for awhile.

November 12, 2024 at 12:07 pm #16392528

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your reply. I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

While checking the debug info, I see that the WordPress Memory Limit is below the requirements. The minimum requirements are 128M, but we do recommend 256M and the debug information of your site shows it set to 40M. Please check this link for more details
https://wpml.org/home/minimum-requirements/.
You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:

define( 'WP_MAX_MEMORY_LIMIT', '256M' );
define( 'WP_MEMORY_LIMIT', '128M' );

After adding the code you can confirm that the memory was changed correctly from WPML > Support > WordPress > Memory limit.

November 12, 2024 at 7:32 pm #16394394

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Sorry, I broke the site while troubleshooting it and the FTP access is not working.

Could you restore the site and provide a snapshot of the site? Alternatively, with your permission, I can create one myself. For this purpose, I typically recommend using the free plugin "Duplicator." If you're already familiar with Duplicator (https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.

To guide you further, please adhere to these instructions:

1. View the Duplicator instructions video: hidden link

2. Consult WPML's instructions on providing supporters with a copy of your site: https://wpml.org/faq/provide-supporters-copy-site/

3. If the archive file exceeds 400MB, please use Duplicator's file filters to exclude cache, wp-uploads directory, media, and archive files.

Once you have the archive file ready, kindly share the link with us. You can utilize platforms like Google Drive, Dropbox, or similar for file sharing, as the snapshot file might be large.

Please note that your next reply will be private, visible only to you and me. You can paste the file link there. Rest assured that once the issue is resolved, I will delete the local site.

November 14, 2024 at 12:46 am #16400296

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I'm checking the files now and will let you know if I can get it to work on my local dev server.

November 15, 2024 at 4:39 pm #16409398

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I apologize for the delay. Just letting you know that I would need more time to investigate this and I will come back to you as quickly as possible.

November 18, 2024 at 4:56 pm #16415998

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I apologize for the delay due to the weekend. I've imported the site into my local and I'm having a hard time trying to get the Website to work.

I'll continue to work on your staging site here hidden link and will come back to you as quickly as possible.

November 19, 2024 at 4:56 pm #16420879

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I will need to escalate this further to our 2nd Tier Support for further investigation. Before I do that, could you tell me how the header and footer options are created? You mentioned ACF, but when I checked the ACF field groups, they were empty.

I need more information before I can escalate this.

November 20, 2024 at 3:05 pm #16425371

tolomatic-inc.M

They are ACF field groups that are created in code. There is a "siteoptions" folder under the rmg-site-functionality plugin and that is where they are configured.

November 21, 2024 at 4:47 am #16427237

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I've tried to install the theme and plugins on our sandbox site but it breaks it.

Could you install it for me and try to replicate the issue over there?

hidden link

November 21, 2024 at 4:32 pm #16430303

tolomatic-inc.M

It won't let me upload ACF Pro which is needed in order to install our plugin as well as our theme.

November 21, 2024 at 5:24 pm #16430487

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. I've added ACF pro. Could you continue?

November 21, 2024 at 8:37 pm #16431063

tolomatic-inc.M

I have set up that sandbox site with our theme and plugin and am able to reproduce that error. I added a few items to the supplemental nav and when viewing incognito, I only get the English versions of those links on both the English and German translated pages. The translations do work correctly when I am logged in.

hidden link
hidden link

November 22, 2024 at 5:48 am #16431862

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. I can see the issue too. I will escalate this to our 2nd Tier Support for further investigation.

November 25, 2024 at 4:42 pm #16441304

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Sorry for the delays, our 2nd Tier Support is still investigating this and I will come back to you as quickly as possible.

November 29, 2024 at 2:22 pm #16459951

George Botsev
WPML Supporter since 02/2014

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello!
I am George from the second tier support and your ticket reached me.
After a brief check, I found a code in your custom theme in the file: wp-content/plugins/rmg-site-functionality/inc/ACF_Group.php
exactly in the method named: \RMG\Tolomatic\SiteFunctionality\ACF_Group::acf_init_settings_page

It appears that you have there a return "false" clause there, done on `acf/init`:

	/**
	 * Initialize the field group as a settings page if $is_settings_page is true
	 *
	 * @return false
	 */
	public static function acf_init_settings_page() {
		if ( ! current_user_can( 'edit_theme_options' ) ) {
			return false;
		}

this is the code responsible for the issue that only when the user is logged-in the translations are being shown.

This code short-circuits the logic to populate properly the ACF option names, and when WPML and respectively ACFML plugin checks for the option group and tries to translate the values, this returns `false` if the user is not logged-in.

My suggestion is to comment-out that code and refactor it so that it works better for you. (perhaps the hook acf/init is not suitable and too early for this code?)

I have not analysed further what this code actually does, but once I commented-out the return false cause, I got the translations even when not logged-in.