Background of the issue:
I'm using ACF Pro 6.3.10 trying to visit a page in admin but instead I get a WPML error.
Just to be clear this is not a ACF Pro issue, the problem is inside wpml-posts-listing-page.class.php line 26 when using PHP 8.2 in WPML 4.6.13
See screenshot here hidden link
I fixed the issue by creating a new count() function similar to this https://stackoverflow.com/a/74263588/261365 then use that function instead.
Symptoms:
Fatal error on wpml-posts-listing-page.class.php line 26 on PHP 8.2 in WPML 4.6.13. I expected to see no PHP Fatal error, but instead, I got a Fatal error.
I understand the issue you're facing. Based on the WPML Debug Info, it seems that the ACF Multilingual plugin is not currently active on your site. For ACF field translations and other related features to function correctly within the WPML environment, it's essential to activate the ACF Multilingual plugin.
Once the ACF Multilingual plugin is activated, please check if the issue persists. If you haven't installed it yet, please do that by going to the "Plugins > Add New > Commercial" tab.
I’d also like to mention that in a similar case, we found that the issue was related to an empty custom post type, and setting the "Hierarchical" value to "False' resolved the problem.
'hierarchical' => false
If you’re encountering this issue with a specific custom post type and the issue persists even with the AACF multilingual plugin, please try setting the "Hierarchical" value to "False" — this should help resolve the problem.
Please try out the suggestions and let me know how it goes. I'll be happy to help if you need further assistance in this matter.
I understand what you are suggesting here.
But overall your message felt not in the right direction because a fatal error occurred due to PHP 8.2, and by the way it is a fatal error, which meant it is never meant to happen. A fatal error should never happen regardless of activated ACFML or not. Same with hierarchical false or true, still a fatal error occurred.
Even though I did check ACFML, I'm still not sure why I need those features, when ACF Pro works fine with WPML without ACFML.
Also, your message sounded like you do not want to support PHP 8.2
If you can confirm would be great to know. Thank you
Hi There!
Thank you for your feedback. I’d like to clarify a few points and address your concerns directly.
Firstly, WPML fully supports PHP 8.2, and with the latest updates, compatibility extends up to PHP 8.3. If you’re experiencing a fatal error, this may not directly relate to WPML itself. We’re committed to ensuring that our plugins operate smoothly on these PHP versions.
The recommendation to use the ACF Multilingual plugin is intended to ensure ACF works seamlessly with WPML across all languages. While ACF Pro may work with WPML on its own, ACFML provides the necessary compatibility layer for ACF fields to work correctly with WPML. For sites using ACF across languages, ACFML is recommended to avoid any unexpected behavior.
Additionally, setting the post-type hierarchical option to “false” was suggested based on a similar issue we encountered in another case. It’s a troubleshooting step that might help address this issue in your case as well.
Could you please try installing ACFML and adjusting the hierarchical setting as recommended? If the error persists, we’ll be more than happy to investigate further and find a resolution for you.
Thank you again for your cooperation, and please don’t hesitate to reach out with any further questions.