This thread is resolved. Here is a description of the problem and solution.
Problem:
The client encountered a fatal error after updating ACFML on a site running PHP 8.0.
Solution:
We recommended the client to apply a patch to the ACFML plugin. The client should first back up their site, then edit the
classes/Strings/Traversable/Field.php
file within the ACFML plugin. They need to locate a specific section of code and replace it with a new one that includes a check to ensure that only strings are passed to the transformer function.
Additionally, to translate strings, the client should customize the code in their
functions.php
file with a provided snippet that uses the
acf/load_field
filter.
We also informed the client that our development team is aware of the issue and is working on a permanent fix, but we cannot provide an exact timeline for its release. We will keep the client updated on the progress.
If this solution does not apply to your situation, or if it seems outdated, we recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, 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.
Tagged: Bug
This topic contains 23 replies, has 3 voices.
Last updated by Ilyes 1 year, 7 months ago.
Assisted by: Ilyes.
Author | Posts |
---|---|
May 25, 2023 at 6:28 am #13712157 | |
Ton |
Since I have no save place to upload it and share it with you, I have uploaded the complete site to the earlier provided FTP. It's a .zip file in the public HTML root. It contains everything you need. |
May 26, 2023 at 5:14 pm #13724737 | |
Ilyes Supporter
Languages: French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hey Ton, I entirely shared your theme and site copy with our developers and I have also shared the workaround you made. However, I tried to reproduce the error locally, and I got different errors about the same Function get_global_option($name) but never the same results. But this should be enough for the developers to suggest a solution and give us more insight on how we can avoid this. Thanks again for your patience! |
May 29, 2023 at 4:04 pm #13734027 | |
Ilyes Supporter
Languages: French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hello Ton, Thanks for your patience, Our developer have suggested the following patch : After running a backup, edit ACFML classes/Strings/Traversable/Field.php and replace : protected function transform( Transformer $transformer, $value, $config ) { if ( is_array( $value ) ) { foreach ( $value as $key => $label ) { $value[ $key ] = $transformer->transform( $label, $config ); } } else { $value = $transformer->transform( $value, $config ); } return $value; } with: protected function transform( Transformer $transformer, $value, $config ) { if ( is_array( $value ) ) { foreach ( $value as $key => $label ) { if ( is_string( $label ) ) { $value[ $key ] = $transformer->transform( $label, $config ); } } } else { $value = $transformer->transform( $value, $config ); } return $value; } And if you want to translate the strings, you need to customize the code in the functions.php file to: add_filter('acf/load_field/key=field_6452d0242b965',function($field) { $field['choices'] = array( 'group1'=>array('val1'=> __( 'Value 1', 'my_plugin' ), 'val2'=> __( 'Value 2', 'my_plugin' )), 'group2'=>array('val3'=> __( 'Value 3', 'my_plugin' ), 'val4'=> __( 'Value 4', 'my_plugin' )), ); return $field; }); I hope this helps, Thanks, |
May 30, 2023 at 6:35 am #13736097 | |
Ton |
Hello Ilyes, Yeah that seems to work. Will this be in the next update? |
May 30, 2023 at 9:22 am #13737507 | |
Ilyes Supporter
Languages: French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hey again, Thanks for the confirmation, I'm afraid I cannot yet confirm if this will be in the next update or not, but I could promise you to keep an eye on the progress of the escalated ticket. This is a fresh case, and it is now in the hands of our developers, I hope the workaround is enough for now until we get updates on the possibility of getting it in new updates. We appreciate your understanding, |
May 30, 2023 at 1:08 pm #13739899 | |
Ton |
Will I be updated here on the progress? |
May 30, 2023 at 2:00 pm #13740561 | |
Ilyes Supporter
Languages: French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hey again, Yes, indeed, you could expect an update through this ticket, Best, |
June 27, 2023 at 8:07 am #13900271 | |
Ton |
Any news on this? When it might be fixed in the plugin itself? |
June 27, 2023 at 9:50 am #13901059 | |
Ilyes Supporter
Languages: French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hello Ton, I wanted to provide you with an update regarding your inquiry about the fix for our WordPress plugin, ACFML. First and foremost, I want to assure you that your concern has been escalated to our development team, and our developers have already recognized the importance of resolving this matter and have it on their agenda. However, due to various factors involved in the development process, I regret to inform you that it is currently not possible for me to provide an exact timeline for the implementation of the fix. Our team is working diligently to ensure that the solution is comprehensive and meets the highest standards of quality. As you may be aware, software development can be a complex and iterative process, and unforeseen challenges may arise during the course of development. We want to ensure that the fix is thoroughly tested and verified before releasing it to avoid any further issues or complications for you and our other valued clients. Rest assured, We will keep you updated on the progress of the fix and provide you with a timeline as soon as we have a more accurate estimate. Thank you for your understanding and patience regarding this matter. We truly value your partnership and are dedicated to providing you with the best possible experience with our products. If you have any further questions or require additional assistance, please do not hesitate to reach out to us. Kind regards, |