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, 1 week ago.

Assisted by: Marsel Nikolli.

Author Posts
April 15, 2024 at 6:42 am #15517174

Ton

Hello Marsel,

Yes ofcourse, just do it. It's a test env, so no worries go ahead and give it a try.

April 15, 2024 at 7:50 am #15517440

Marsel Nikolli

Hi Ton,

I tested as well the workaround on the staging site (with the default theme as well) and I noticed an error that was generated. I reported back to the team and will update you as soon as I get feedback.

Regards,
Marsel

April 15, 2024 at 9:36 am #15518623

Marsel Nikolli

Hi Ton,

We've checked further using the default WP theme and we noticed that there is a function on "../themes/twentytwenty/functions.php:814", can you please tell us what is that code used for?

* We checked the workaround provided on a local setup (the copy of your website) and it works correctly.

Looking forward to your reply,
Marsel

April 15, 2024 at 11:28 am #15519624

Marsel Nikolli

Hi Ton,

We did check further and we added the following code as well to adjust the workaround code provided earlier:

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

	return $post_id;
}, 11);

It should be working on the staging site using your theme. Please check and test with a new post and let me know.

Regards,
Marsel

April 15, 2024 at 1:49 pm #15520489

Ton

Hello Marsel,

That indeed worked. Is it something weird I do or just an edge case?
Will this be fixed in an update on your end, or do i always need it in my theme?

Hope to get a last reply on this matter.

April 15, 2024 at 2:37 pm #15520863

Marsel Nikolli

Hi Ton,

I've checked with the team and this is a bug that will be fixed in future updates of WPML.

Thank you for understanding.

Kind regards,
Marsel

April 16, 2024 at 8:58 am #15523630

Ton

Thanks for the update, than my issue now is completely resolved. Thanks for the time and patience.