Skip Navigation

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

Problem:
The client was experiencing issues with Advanced Custom Fields (ACF) data not displaying correctly when previewing a page. The site was already running on PHP 8.3, which is not fully compatible with WordPress and WPML.

Solution:
1. We recommended downgrading PHP to version 8.1 to check if the issue persists, as PHP 8.3 might cause compatibility issues.
2. We requested a copy of the client's website to escalate the issue to our second-tier support team.
3. We provided a workaround code to adjust the ACF data display and confirmed that the issue is a known bug and will be addressed in a future update of WPML.

Please note that the solution provided might be irrelevant due to it being outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, please open a new support ticket with us.

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.

This topic contains 20 replies, has 2 voices.

Last updated by Marsel Nikolli 7 months, 3 weeks ago.

Assisted by: Marsel Nikolli.

Author Posts
April 2, 2024 at 9:19 am #15471641

Ton

In reference to this chat:
https://wpml.org/forums/topic/wpml-chat-support-ticket-by-ton-1712046994/

They told us to install PHP 8.1, but we are running PHP 8.3 already, so that should be good right?

April 2, 2024 at 9:57 am #15471937

Marsel Nikolli

Hi,

Thank you for contacting WPML Support, I will gladly help you.

WordPress site the PHP v8.3 is still not fully compatible:
https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/, as a result, WPML is working on this side as well.

I suggest checking if the issue persists by downgrading the PHP to v8.1.

* Note: Please make sure you have a full backup of your website before making any updates/changes to your website.

Let me know how it goes,
Marsel

April 2, 2024 at 12:59 pm #15472971

Ton

Hello Marsel,

I don't have PHP 8.1, i put it to PHP 8.0, still the problem persists.

April 2, 2024 at 1:08 pm #15473013

Marsel Nikolli

Hi Ton,

Thank you for the update.

I've checked both links you shared on the chat with my colleague and on my end, none of them work (even the one without the preview=1 removed).

Could you please provide the WordPress debug.log file content?
More Info: https://wordpress.org/support/article/debugging-in-wordpress/

To enable debug.log, open your wp-config.php file and look for:

define('WP_DEBUG', false);

And change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Then try to reproduce the issue and check if any errors were saved to the debug.log log file inside the “.../wp-content/” directory.

If you can paste your debug.log to https://pastebin.com/ and provide me with that link, it would be great!

* Please do not paste the debug.log content in your reply.

Thanks,
Marsel

April 2, 2024 at 1:58 pm #15473316

Ton

Hello Marsel,

Nothing appears in the logs, the stay empty.

I added a screenshot with the preview=1 in the url (screen1.png) and a screenshot without the preview=1 in the url (screen2.png).

Hope to hear from you.

Kind regards

2.png
1.png
April 2, 2024 at 2:24 pm #15473600

Marsel Nikolli

Hi Ton,

Thank you for the screenshots and the update.

I would need temporary access to your site's WP-admin to investigate this issue and understand it better. Please create an administrator user using any email address you prefer.

Please fully back up your site (files and database) and confirm it in your next reply.
* Note: I might need to enable/disable plugins and switch themes.

Your next reply is set to private for you to provide the username and password details.

Thanks,
Marsel

April 3, 2024 at 4:13 pm #15479543

Marsel Nikolli

Hi Ton,

Thank you for the access, I was able to check and it seems that the issue is with the theme.

I've tested with a default WP theme and it seems to work correctly, please check the video at this link: hidden link

Could you please check on your end, if the issue persists when switching to a default theme?

April 4, 2024 at 5:43 am #15480943

Ton

Hello Marsel,

It's not about the titleh, wich is default in the twentytwenty theme. It's about the ACF fields.

If you look at this page: hidden link when the twentytwenty theme is active, you see the ACF content.

But than at the review page of that page you don't see it: hidden link

Again, when I remove the "preview=1" from the URL you do see the content, which would be the expected effect.

Could you please look again?

Kind regards

April 4, 2024 at 2:14 pm #15484086

Marsel Nikolli

Hi Ton,

I've checked further and in the debug info you shared with my colleague on the chat, I noticed that the default language of the website is German, meanwhile on the website right now the default language is Deutch.

- Can you please tell me in which language was page you shared created originally?
- Can you please test if the issue happens with a new page?

Looking forward to your reply,
Marsel

April 4, 2024 at 5:55 pm #15485246

Ton

Hello Marsel,

As you can see here the default language for the site is Dutch:
hidden link

The page was first created in Dutch.
I just created a new page in Dutch:
hidden link

Now when you click on the "eye" icon in the CMS for that page, it still won't show the ACF data.

As said earlier, you can test anything you want on this testsite.

Kind regards

April 5, 2024 at 10:45 am #15487478

Marsel Nikolli

Hi Ton,

Thank you for the updates, I would require a copy of your website to test it locally and further escalate the issue to the 2nd tier support team.

You can use the Duplicator plugin(https://wordpress.org/plugins/duplicator/) to create a copy of your website and upload the backup on a file-sharing website (Google Drive, Dropbox, etc.), please send me the link to download the backup after.

* Please try to minimize the size of the backup file by excluding unnecessary media files or backup folders that might be in the "/wp-content/" folder.

I’ve set your next reply as private so you can provide the backup link.

Thank you,
Marsel

April 8, 2024 at 9:41 am #15493320

Marsel Nikolli

Hi Ton,

Thank you for providing a copy of your website.

I've escalated the issue to our 2nd tier support team.
I'll update you as soon as I have feedback.

Regards,
Marsel

April 10, 2024 at 7:23 am #15502448

Marsel Nikolli

Hi Ton,

I got feedback from the team, they suggested adding the following code to your theme functions.php file:

/**
 * @link wpmlsupp-11601
 */
add_filter('acf/validate_post_id', function($post_id){
	if (isset($_GET['wpmlReviewPostType']) && isset($_GET['preview']) && !empty($_GET['preview_id'])) {
		return intval($_GET['preview_id']);
	}

	return $post_id;
},11);

* Note: Please make sure you have a full backup of your website before making any updates/changes to your website.

Let me know if this works out for you.

Kind regards,
Marsel

April 11, 2024 at 7:43 am #15507409

Ton

Hello Marsel,

I added the code and in the TwentyTwenty theme it still isn't showing the content.
Again, when I remove the "preview=1" it shows the translated (to be reviewed) text.

Why does it need the "preview=1"? Can't i do without?
Just throwing out a couple of questions.

Hope to hear from you.

April 11, 2024 at 8:29 am #15507665

Marsel Nikolli

Hi Ton,

Thank you for the update.

The "preview=1" is default from WordPress and WPML for the preview functions.

Is it ok if I give it a try?