Skip Navigation

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

Problem:
The client is experiencing an Error 500 when saving any existing posts in WordPress after updating the ACFML plugin. The error is caused by a TypeError in the HashCalculator.php file.
Solution:
We recommend updating the ACFML plugin to the latest version, which at the time of the support was version 2.1.2. To update, navigate to Plugins > Add New > Commercial tab and then check for updates.

Please note that this solution might be outdated or not applicable to your case. If after following these steps the issue persists, we highly 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 continues, please do not hesitate to 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: 

This topic contains 10 replies, has 2 voices.

Last updated by Long Nguyen 8 months, 1 week ago.

Assisted by: Long Nguyen.

Author Posts
May 2, 2024 at 6:59 pm #15588871

matejK-16

Hi,
since updating ACFML we're experiencing the following error when saving any of our existing posts in WP. This throws Error 500 and pages won't save. We're unable to make any changes now.

Error Details
=============
An error of type E_ERROR was caused in line 65 of the file
/public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php. Error message: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php:65
Stack trace:
#0 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(65): count()
#1 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(52): ACFML\Helper\HashCalculator::isArrayOfArrays()
#2 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(25): ACFML\Helper\HashCalculator::hashArray()
#3 [internal function]: ACFML\Helper\HashCalculator::calculate()
#4 /public_html/web/app/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map()
#5 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(86): WPML\Collect\Support\Collection->map()
#6 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(52): ACFML\Helper\HashCalculator::hashAssociativeArray()
#7 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(25): ACFML\Helper\HashCalculator::hashArray()
#8 [internal function]: ACFML\Helper\HashCalculator::calculate()
#9 /public_html/web/app/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map()
#10 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(74): WPML\Collect\Support\Collection->map()
#11 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(52): ACFML\Helper\HashCalculator::hashArrayOfArrays()
#12 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(25): ACFML\Helper\HashCalculator::hashArray()
#13 [internal function]: ACFML\Helper\HashCalculator::calculate()
#14 /public_html/web/app/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603): array_map()
#15 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(86): WPML\Collect\Support\Collection->map()
#16 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(52): ACFML\Helper\HashCalculator::hashAssociativeArray()
#17 /public_html/web/app/plugins/acfml/classes/Helper/HashCalculator.php(25): ACFML\Helper\HashCalculator::hashArray()
#18 /public_html/web/app/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php(283): ACFML\Helper\HashCalculator::calculate()
#19 /public_html/web/app/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php(80): WPML_ACF_Repeater_Shuffle->calculateHash()
#20 /public_html/web/wp/wp-includes/class-wp-hook.php(324): WPML_ACF_Repeater_Shuffle->store_state_before()
#21 /public_html/web/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#22 /public_html/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action()
#23 /public_html/web/app/plugins/advanced-custom-fields-pro/includes/acf-form-functions.php(143): do_action()
#24 /public_html/web/app/plugins/advanced-custom-fields-pro/includes/forms/form-post.php(318): acf_save_post()
#25 /public_html/web/wp/wp-includes/class-wp-hook.php(326): ACF_Form_Post->save_post()
#26 /public_html/web/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#27 /public_html/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action()
#28 /public_html/web/wp/wp-includes/post.php(4828): do_action()
#29 /public_html/web/wp/wp-includes/post.php(4930): wp_insert_post()
#30 /public_html/web/wp/wp-admin/includes/post.php(453): wp_update_post()
#31 /public_html/web/wp/wp-admin/post.php(227): edit_post()
#32 {main}

May 3, 2024 at 4:23 am #15589495

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi there,

Thank you for contacting WPML support, I’m happy to help you with this issue.

Another user also reported this issue and it has been escalated to our 2nd tier support. I will let you know once I have any information.
https://wpml.org/de/forums/topic/advanced-custom-fields-multilingual-3/

Thanks.

May 6, 2024 at 6:27 am #15595121

matejK-16

Hi,
any updates? We're unable to make changes on our website.
Thanks

May 6, 2024 at 6:34 am #15595139

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Currently, I don't have more information. Can you please share a backup file of your site and database? I will send it to the 2nd tier support to investigate the issue on your site. You can use a third-party plugin such as Duplicator, All-in-One WP Migration
https://wordpress.org/plugins/all-in-one-wp-migration/
https://wordpress.org/plugins/duplicator/

Note: please exclude some unnecessary folders like /wp-content/uploads/, /wp-content/cache/ ... to reduce the file size. Your next reply is set to private to share the info.

Thanks.

May 6, 2024 at 12:00 pm #15597149

matejK-16

Hi,
just to add - this issue happens when we're trying to update existing pages. All other post types can be saved without any issues.

May 7, 2024 at 1:14 am #15599518

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Our 2nd tier support identified the issue and released documentation to fix this. Please follow the workaround in the link below and let me know if it helps.
https://wpml.org/errata/advanced-custom-fields-fatal-error-uncaught-typeerror-count-argument-1-value-must-be-of-type-countablearray-wp_post-given/

Looking forward to your reply.
Thanks

May 7, 2024 at 4:44 am #15599661

matejK-16

Hi,
I've tried that (option 2) but the website returns 503 error.

Screenshot 2024-05-07 at 06.43.35.png
May 7, 2024 at 6:49 am #15600025

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

If option 2 doesn't help, you can try to apply option 1. Let me know how it goes.

May 7, 2024 at 9:07 am #15600513

matejK-16

Hi,

I'm sorry but that's not very helpful - I need Option 2 to work (or other alternative).
I don't want to "Keep repeater and flexible sub-fields in the same order as the default language", we sometimes change the order of these fields.

Any ideas please?

May 7, 2024 at 9:16 am #15600569

matejK-16

Also, where's this option please? I can't find it anywhere. Thanks

May 8, 2024 at 2:55 am #15604121

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Please update ACFML plugin to the new version 2.1.2 and check this issue again: go to Plugins > Add New > Commercial tab > Check for updates.

Looking forward to your reply.
Thanks