Home›Support›English Support›[Resolved] Warning: Undefined array key "value" in abstract-acf-location.php
[Resolved] Warning: Undefined array key "value" in abstract-acf-location.php
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing 'Undefined array key "value"' errors when translating a CF7 form and other elements using WPML with Advanced Custom Fields Pro. The errors occur specifically in the Spanish translations and are related to the settings of ACF field groups. Solution: 1. Ensure that the ACF Pro plugin is updated to version 6.4.3 or higher. 2. Set the ACF Field Groups to 'Not translatable' in WPML > Settings > Custom Post Type Translation. 3. Remove any duplicated field groups for languages other than the default site language. 4. After making these adjustments, re-translate the affected content. 5. If the issue persists, check if all field groups have a location setting and that they are not set for a post type that no longer exists on the site.
It's important to note that setting field groups to 'Translatable' is not recommended using the ACF Multilingual addon. For more details on configuring ACF with WPML, visit WPML's ACF documentation.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, please open a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.
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.
Background of the issue:
I am trying to translate a CF7 form into Spanish and I encounter error messages on the right sidebar. The issue can be seen on this page: hidden link
Symptoms:
Warning: Undefined array key "value" in /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php on lines 174 and 177.
Questions:
How can I resolve the 'Undefined array key "value"' error when translating a CF7 form?
Is there a compatibility issue between WPML and Advanced Custom Fields Pro?
I wanted to translate the footer as well in ES but I now get the following error thrown as well:
Warning: Undefined array key "value" in /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php on line 174
Someone the separate language pages for the footer appeared and I was able to translate them.
But the error message : Warning: Undefined array key "value" in /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php on lines 174 and 177.
For ES the titles of the pages are not shown in WP Admin / pages.
There getting the same error message "Warning: Undefined array key "value" in /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php on lines 174"
I already installed v 6.4.3 but the issue persists.
Warning: Undefined array key "value" in /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php on line 174
Warning: Undefined array key "value" in /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /www/wwwkeytalkcom_402/public/wp-content/plugins/advanced-custom-fields-pro/includes/locations/abstract-acf-location.php:177) in /www/wwwkeytalkcom_402/public/wp/wp-admin/admin-header.php on line 14
Could you please give me some more information on how I can check the things that you have mentioned? I'm not well versed with ACF / WPML as someone else set this up.
I do saw in ACF / Field Groups and for ES that the same error messages are shown in the "Title" column.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Taking a closer look at the provided debug information, it looks like you have set the ACF Field Groups inside WPML > Settings > Custom Post Type Translation to "Translatable", which is not recommended.
Please set the ACF Field Groups to "Not translatable" and remove any duplicated field groups from the site.
If this does not solve the issue, please let me know.
I have set ACF Field groups to "Not translatable".
But when I go to ACF Field Groups i see for each language 13 entries. English only has 5. But It is only ES that gives this PHP error. The other languages, besides EN, shows title in the correct way.
Where would I find these "duplicate" field groups that you are referring to? In the ACF or WPML section in the admin dashboard?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
The problem must have been that the field groups were translated.
We no longer recommend setting field groups to "Translatable" when using ACF without out ACF Multilingual addon. There is no need to translate the groups.