Skip to content Skip to sidebar

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

Problem:
If you're experiencing a critical error on your translated site pages, it might be due to a PHP Fatal error indicating a type mismatch. Specifically, the error occurs because the code expects an array but receives a string instead. This issue often arises with ACF custom fields that are not correctly handled in translations.
Solution:
We recommend checking the ACF custom fields used in your template. Ensure that fields such as 'section_details', 'section_info', and 'section_map' are properly registered for translation with WPML and are returning arrays as expected. Here's what you might see in your code:

$salon_details = get_field('section_details');

$salon_info = get_field('section_info');

$salon_map = get_field('section_map');

$map_link = $salon_details['map_link'];

$address = $salon_info['address'];

$coords = $salon_map['lat_lang'];

Please confirm where these fields are defined: Are they attached to a specific page, a custom post type, or an ACF Options Page? If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we 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. If problems persist, please open a new support ticket.

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.

This topic contains 18 replies, has 0 voices.

Last updated by rafalK-25 4 days, 4 hours ago.

Assisted by: Bruno Kos.

Author Posts
December 10, 2025 at 6:57 am #17649977

rafalK-25

Hi, after translation most part of site got critical error while entering translated parts.

December 10, 2025 at 7:19 am #17650115

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Please enable the WordPress debug log. This will allow us to see if any PHP errors are being produced.

1. Edit wp-config.php and insert the following lines (just before /* That's all, stop editing! Happy publishing. */ part)

define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true);
define( 'WP_DEBUG_DISPLAY', false);

2. Reproduce the issue.

3. Locate the debug log in: /wp-content/debug.log

4. Paste the latest lines here. No need to paste the entire log file, just 20 lines or so will do. Please censor any sensitive information.

https://codex.wordpress.org/Debugging_in_WordPress

December 11, 2025 at 9:37 am #17654928

rafalK-25

[11-Dec-2025 09:33:45 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/host658063/domains/nusaspa.pl/public_html/wp-content/themes/nusaspa/templates/page-reservation.php:26
Stack trace:
#0 /home/host658063/domains/nusaspa.pl/public_html/wp-includes/template-loader.php(125): include()
#1 /home/host658063/domains/nusaspa.pl/public_html/wp-blog-header.php(19): require_once('/home/host65806...')
#2 /home/host658063/domains/nusaspa.pl/public_html/index.php(17): require('/home/host65806...')
#3 {main}
thrown in /home/host658063/domains/nusaspa.pl/public_html/wp-content/themes/nusaspa/templates/page-reservation.php on line 26

December 11, 2025 at 11:40 am #17655775

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

These notices would not tell us about the cause, however this points us into a possible cause of this:

[11-Dec-2025 09:33:45 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/host658063/domains/nusaspa.pl/public_html/wp-content/themes/nusaspa/templates/page-reservation.php:26 Stack trace: #0 /home/host658063/domains/nusaspa.pl/public_html/wp-includes/template-loader.php(125): include() #1 /home/host658063/domains/nusaspa.pl/public_html/wp-blog-header.php(19): require_once('/home/host65806...') #2 /home/host658063/domains/nusaspa.pl/public_html/index.php(17): require('/home/host65806...') #3 {main} thrown in /home/host658063/domains/nusaspa.pl/public_html/wp-content/themes/nusaspa/templates/page-reservation.php on line 26

This error means that on line 26 of page-reservation.php, the code expects an array but is receiving a string, so PHP cannot do $value['something'] on it.

WPML often triggers this when a field that is normally an array (ACF, theme options, repeater, etc.) is not translated or gets returned as a string in the translated version.

Would you be willing to provide me with WordPress and FTP credentials so I could investigate the issue directly?

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

I marked your next reply as private so that you can safely add credentials.

I would like to check the line 26 in page-reservation.php to see what exactly is there and why it fails.

December 12, 2025 at 2:12 pm #17659580

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Can you tell me if this FTP is for this site or some other? It seems to belong to hatimassage.pl (or some other site) so I can't see its files or debug logs.

December 15, 2025 at 10:16 am #17663420

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

I believe the issue is caused by ACF custom fields used in the template that are not correctly handled in translations.

The template expects the following ACF group fields to return arrays:

* section_details
* section_info
* section_map

In particular this:

        $salon_details = get_field('section_details');
        $salon_info = get_field('section_info');
        $salon_map = get_field('section_map');
        $map_link = $salon_details['map_link'];
        $address = $salon_info['address'];
        $coords = $salon_map['lat_lang'];

On translated pages, these fields appear to return a string or empty value instead, which leads to the PHP error. This usually happens when the fields are not properly registered for WPML or are defined in a different context, such as a custom post type or an options page.

Could you please confirm where these custom fields are defined?

* Are they attached to a specific page?
* A custom post type (for example locations or salons)?
* Or an ACF Options Page?

Thank you.

December 18, 2025 at 11:38 am #17674457

rafalK-25

Hey, i've managed to edit some parts of that code to match wmpl requirements, but still a lot of images/nav and other parts of site are missing even after full automatic translation.

I've got rid of most of critics, but still need solution for other parts, please just check main site and try to change to /en/ and take a look what happens 🙂

December 19, 2025 at 6:58 am #17676700

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Can you check now?
hidden link

I've noticed that hidden link was empty in fact, no ACF fields were there at all so there was nothing to render in the frontend. It was because acf-field-group was set as "translate" on hidden link

December 23, 2025 at 6:40 am #17683890

rafalK-25

Thank you, that changed actually a lot and most things are visible now.

Can u take a look at almost last thing, price list
hidden link / hidden link

December 23, 2025 at 1:43 pm #17684842

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Can you tell me where is that price list coming from? Maybe VOUCHER KWOTOWY? Because even when I removed that from hidden link, it still showed up on hidden link

kwo.jpg
December 29, 2025 at 9:04 am #17694368

rafalK-25

The price list comes from ACF Options (section_price_list_custom) which contains a repeater field (categories_repeater) linking to WooCommerce products and a custom "Services" CPT.

The template file is: template-parts/sections/s-price-list-dynamic.php

December 29, 2025 at 12:53 pm #17694811

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

It is this, correct?
hidden link

"Sekcja - Cennik dynamiczny"?

But if I switch to hidden link, it looks be empty, and these options are to be translated like this https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-the-acf-options-page-custom-fields-with-wpml/#translating-options-page-custom-fields

January 2, 2026 at 8:36 am #17699830

rafalK-25

yea, exactly thats the point that its empty..
how to deal with it ?

January 2, 2026 at 11:15 am #17700149

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

You need to translate them like this:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-the-acf-options-page-custom-fields-with-wpml/#translating-options-page-custom-fields

If you enter only few values as a test, do they show up hidden link?

January 7, 2026 at 8:47 am #17708565

rafalK-25

Hey! i've managed to translate that price list 🙂 thank you 🙂

probably the last one thing are buttons with links like "oferta" etc. any idea how to fast detect them and translate?