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, 4 months ago.
Assisted by: Ilyes.
Author | Posts |
---|---|
April 17, 2023 at 8:53 am #13485425 | |
Ton |
Hello, On updating ACFML I get a fatal error : https://pastebin.com/fWvJvURc I will then try running it in minimal environment on the development site, except back reply by tomorrow. Thank you, |
April 17, 2023 at 10:03 am #13486133 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hello again Ton, Please enable your debug log before doing the testing it under your development site. To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to: define('WP_DEBUG', true); define( 'WP_DEBUG_LOG', true ); In this case, the errors will be saved to a debug.log log file inside the /wp-content/ directory. If you can paste your debug.log to pastebin.com and provide me that link, it would be great! (This is the cleanest way, because sometimes the logs are long and create a complete mess in discussion). https://wpml.org/documentation/support/debugging-wpml/ Best, |
April 17, 2023 at 1:46 pm #13488361 | |
Ton |
I have set up my test: But it's somewhere in my theme I think. function get_global_option($name) But I can't get why. Can you take a look? Where Can i leave credentials? |
April 17, 2023 at 2:04 pm #13488479 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hello, Thank you for the follow-up, Note that the fields required for this access can be found below the comment section when you log in to leave your next reply. The information you provide will be kept private and confidential, accessible only by you and me. You may refer to this video (starting at 1:10) for guidance: hidden link If necessary, I may need to replicate your site locally. To do this, I will temporarily install a plugin called “Duplicator” on your site, which will enable me to create a copy of your site and its content. Once the problem has been resolved, I will delete the local site. Please let me know if you agree to this. It is important to note that you should back up your site and database before proceeding, and you can use a plugin like Duplicator for this purpose. Here’s a link to the plugin: http://wordpress.org/plugins/duplicator/ If you do not see the form below, please do not enter your credentials as they will be publicly exposed: hidden link For your privacy and security, please ensure that you make your reply a private one. Best regards, |
April 18, 2023 at 10:13 am #13494389 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Greetings, Many thanks for sharing the access. You now have the option to restore your dev site as it is currently broken. It seems that the persistent issue could be related to your theme, "Webton Theme," as it was enabled during the occurrence. My assumption is that some parts of the theme may not be compatible with WPML since it has not been tested by our developers or the author (there is no WPML-related information available on the Webton site). To determine if the issue is occurring due to the staging site's configuration or the combination of the Webton theme and WPML (and ACFML), we must isolate the issue. I have created a sandbox environment here: hidden link WPML has been configured in two languages already. Please perform the following: - Access the sandbox link mentioned above. - Download and activate ACF PRO, ACFML. - Activate the Webton theme. => We can then observe if the issue occurs in this environment. Please note that we only require the theme/plugin and the related functionality, and there is no need to set up an entire website or clone your existing site. For more information, please visit: https://wpml.org/faq/how-to-reproduce-issues-and-share-them-with-wpml-support/ Kindly notify me once you have completed the above steps. Warm regards, |
April 19, 2023 at 11:21 am #13504167 | |
Ton |
I further investigated myself, and saw that when I disable "WPML String Translation" the website has no issues too. Maybe it's not acfml after all? I don't know how your plugins work internally. Looking into the code of where the fatal error originates, it looks like it has no value for the function getStringName in classes/Strings/Package.php on line 97 But when I look at the translate function and added a print_r on the value. But then if I look at the translate function, wich expects a string there is this function: public function translate( $value, $stringData ) { if ( $value ) { return apply_filters( 'wpml_translate_string', $value, self::getStringName( $value, $stringData ), $this->getPackageData() ); } return $value; } I would suggest to add is_string($value) to the following code making sure it's a string: public function translate( $value, $stringData ) { if ( $value && is_string($value) ) { return apply_filters( 'wpml_translate_string', $value, self::getStringName( $value, $stringData ), $this->getPackageData() ); } return $value; } Then all problems are fixed. Since this already is expected to be a string, this is a good way to prevent any errors. Hope to hear from you, |
April 19, 2023 at 7:00 pm #13507485 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hello, Thank you for the detailed follow-up, I'm glad that you found a workaround, however, to better treat this and potentially add it under the upcoming updates, we need to replicate the issue under the Sandbox as I previously suggested. We need clear steps to reproduce it and properly detect which plugins are concerned. Your help and cooperation is really appreciated. Best regards, |
April 20, 2023 at 5:49 am #13508783 | |
Ton |
Hello Ilyes, I kinda understand, but I have my daily stuff to do too. I already gave you a test environment. Isn't that enough? These are not my plugins and besides that, it's always a good practice to check your variables for type. But yet I tried in your sandbox and I made your sandbox crash somehow on installing a plugin i really need for my theme. Could you perhaps delete the plugin "webton-extended" for now? Hope to hear from you. |
April 20, 2023 at 4:47 pm #13513317 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hi Ton, It's good to speak with you again, Regarding the crashed Sandbox, I disabled "webton-extended", but unfortunately, that did not resolve the issue. Therefore, my suggestion is to create a new sandbox and see if we can avoid the problem this time. hidden link I want to share that WPML is a large and complex plugin that requires constant testing and updates, and it is crucial to have a proper workflow to manage it and effectively address any user concerns. To prevent misunderstandings and conduct thorough testing, it would be greatly appreciated if we could replicate the issue in a minimal environment first. Thank you again for sharing your solution, and I have already notified our team about this possible issue. However, using sandboxes is the most reliable way to ensure that we don't miss any unexpected variables. I hope this explanation makes sense, and I appreciate your cooperation. Sincerely, Ilyes |
April 21, 2023 at 5:30 am #13515017 | |
Ton |
Hello,Ilyes, I think the new sandbox now crashed because of the bug I mentioned. I installed the minimum I needed. Hope to hear from you. |
April 21, 2023 at 9:02 pm #13519885 | |
Nicolas V. Supporter
Languages: English (English ) French (Français ) Timezone: America/Lima (GMT-05:00) |
Hi Ton, Ilyes is off today, but in order to save time I have created a new sandbox for you. Could you please reinstall your theme. Do not activate any additional plugin (even if required by your theme). That way Ilyes will have something to start with when he's back. hidden link Unless you prefer to send us a duplicator copy?In that case, you need to temporarily install a plugin called “Duplicator” on your site. This will allow you to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you. Nico |
May 1, 2023 at 5:50 am #13563789 | |
Ton |
Hello, you gonna help me / fix the bug? Taking a long time now. |
May 1, 2023 at 6:37 pm #13565943 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hello Ton, I apologize for not getting back to you sooner, I have been trying to work with your theme, but it kept crashing each time we install it, I escalated this to the second tier but in the meantime, I highly recommend proceeding with our Go-Global program : https://wpml.org/documentation/support/go-global-program/ This allows us to better test your theme and potentially solve any probable compatibility issues. Thank you, |
May 23, 2023 at 6:29 am #13694737 | |
Ton |
I think its done duplicating. |
May 23, 2023 at 4:32 pm #13701753 | |
Ilyes Supporter
Languages: English (English ) French (Français ) Timezone: Pacific/Easter (GMT-05:00) |
Hey Ton, I think the duplication didn't complete correctly, Could you instead give us the complete Site copy (you can upload it under a drive or any other file sharing services) and I will take care of the rest for you. This way you won't have to do it again in case we face issues related to this kind of errors, Thank you again for the cooperation, |