Salta la navigazione

Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.

La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Fuso orario del supporto: Asia/Dhaka (GMT+06:00)

Etichettato: 

Questo ticket contiene 8 risposte, ha 2 voci.

Ultimo aggiornamento da Prosenjit Barman 1 anno fa.

Assistito da: Prosenjit Barman.

Autore Post
Maggio 30, 2024 alle 4:56 pm #15688866

marcoF-29

Contesto del problema:
Sto lavorando su un sito in locale con il plugin ACF Pro e l'add-on per ACF di WPML installati. Ho creato dei layout con il campo flexible di ACF e all'interno ad alcuni di questi layout sono presenti dei campi repeater di ACF. Il sito è multilingua, con Italiano come lingua principale e Inglese come secondaria.

Sintomi:
Quando modifico una pagina in lingua principale che ha una pagina tradotta collegata e contiene almeno un layout del campo flexible di ACF con dentro un repeater, e tento di aggiornare, si verifica un fatal error. L'errore è relativo al file class-wpml-acf-repeater-shuffle.php del plugin WPML. Il messaggio di errore specifico è: 'PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php:175'.

Domande:
Da cosa può dipendere questo errore?
Sembra un bug del plugin relativo specificatamente ai campi repeater all'interno dei campi flexible?

Maggio 31, 2024 alle 10:53 am #15691830

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

To reduce the waiting time, I took this ticket and responded in English. Please let me know if you're okay with it or want to continue the conversation in Italian language. I will check and forward the ticket to one of our Italian supporters to assist you in the Italian language.

After reviewing the WPML debug information, I noticed that the "ACF Multilingual" plugin on your site is not updated to the latest version. We have addressed some issues in the latest release, version 2.1.3. Could you please update the plugin to the latest version and see if the problem persists?

For your information, the code at line 175 in `acf-repeater-shuffle.php` expects an array with meta values, but it is receiving `null`, which is causing the issue on your site. If the problem persists after updating the plugin, you might try removing the Repeater field from the Flexible field within the field group and saving the changes. Then, add the Repeater field again to refresh the meta information.

Please let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

Giugno 4, 2024 alle 9:30 am #15700717

marcoF-29

Hi,
thanks for the reply.

I have already updated all plugins connected to WPML and created a new flexible field with a new repeater field but the problem still occurs.

I also tried disabling the other plugins and using the default WordPress theme but unfortunately the result does not change.

I'll paste the full error below if it helps.

Regards

//------------

PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php:175
Stack trace:
#0 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php(175): array_keys(NULL, 'Indicazioni per...', true)
#1 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php(148): WPML_ACF_Repeater_Shuffle->keys_after_move('Indicazioni per...')
#2 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php(240): WPML_ACF_Repeater_Shuffle->get_keys_for_meta_value_changed('maxxi_blocks_0_...', 'Indicazioni per...')
#3 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-includes/class-wp-hook.php(324): WPML_ACF_Repeater_Shuffle->revertFieldValuesForSignature(Array, 303)
#4 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#5 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-action-helper.class.php(147): apply_filters('wpml_custom_fie...', Array, 303)
#6 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-action-helper.class.php(46): WPML_TM_Action_Helper->get_post_custom_fields(Object(WP_Post))
#7 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(142): WPML_TM_Action_Helper->post_md5(Object(WP_Post))
#8 [internal function]: WPML_TM_Post_Actions->{closure}()
#9 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/AutoUpdate/Hooks.php(107): call_user_func(Object(Closure))
#10 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-includes/class-wp-hook.php(324): WPML\PB\AutoUpdate\Hooks->afterRegisterAllStringsInShutdown('')
#11 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#12 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#13 /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-includes/load.php(1270): do_action('shutdown')
#14 [internal function]: shutdown_action_hook()
#15 {main}
thrown in /Users/macbookproretina/Local Sites/maxxi-dev/app/public/wp-content/plugins/acfml/classes/class-wpml-acf-repeater-shuffle.php on line 175

Giugno 4, 2024 alle 12:32 pm #15702012

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

To determine if the issue is specific to your site or a sitewide problem, please try replicating the issue in our sandbox environment. You can access the sandbox using the Autologin URL provided below.

- link nascosto

WPML and its addons are already installed in the sandbox. Please complete the setup and configure WPML to match the settings of the main site. After that, install the ACF plugin, configure the fields as per your main site, and then try to replicate the issue.

The sandbox environment allows us to determine if the issue occurs in a minimal setup and whether the server configuration influences the problem you've encountered. If you're able to recreate the same issue ion our sandbox, please let me know. I will take a closer look and assist you accordingly.

Best regards,
Prosenjit

Giugno 7, 2024 alle 1:30 pm #15716787

marcoF-29

Hi,
thanks for the reply and for the sandbox.

I'm trying to replicate the problem, but I need the Advanced Custom Fields Multilingual addon. I can't install it because it says "Unable to register: Site key not matching". Could you install and enable this addon so I can try to replicate the situation on my site?

Thank you

Giugno 8, 2024 alle 9:25 am #15718163

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hi,
Thank you for the update.

I installed the latest version of ACF Multilingual addon plugin and activated it on the Sandbox. Please continue to configure the plugins and try to replicate the issue on the Sandbox.

Feel free to let me know if there's anything else you need help with in the sandbox. I'll be happy to help.

Best regards,
Prosenjit

Giugno 13, 2024 alle 11:57 am #15736027

marcoF-29

HI,

I replicated the problem in the sandbox. I also installed the WP Debugging plugin to see the debug.log.

To view the problem just go to Pages and open the 'Test page 2' page that I created. The page has a synchronized translated version. If you edit the block called 'Fisarmonica', which has a repeater inside, and update it, a white screen with a fatal error will appear with the error copied to the top of this discussion.

The white error page appears only if the translated post is synced. However, if the translated post is marked as 'translate separately' the white error screen no longer appears but the fatal error still occurs, as can be seen in the debug.log.

The problem is that this is a blocking bug in a site that will be published soon. So if it can be resolved quickly, or if there is a temporary solution while the bug is resolved, it will be very welcome.

Thank you

Giugno 14, 2024 alle 4:50 am #15738149

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well!

Thank you for replicating the issue in the sandbox and sharing the details about what caused it. This is incredibly helpful!

I took a copy of the sandbox and currently investigating the issue. As soon as I have any information regarding this issue, I will surely inform you.

Once again, thank you so much for your effort and kind cooperation in this matter.

Best regards,
Prosenjit

Giugno 14, 2024 alle 6:19 am #15738236

Prosenjit Barman
Sostenitore di WPML dal 03/2023

Lingue: Inglese (English )

Fuso orario: Asia/Dhaka (GMT+06:00)

Hi!

I investigated the issue and discovered that one of the attributes in a function is receiving a 'null' value, which is causing the problem. I am currently discussing this matter with our second-tier team, and we hope to find a solution soon.

In the meantime, I found that if I shuffle the field groups or disable the synchronization of flexible and repeater fields option (Screenshot: link nascosto) within the page editor, the issue does not reoccur. Therefore, the recommendation is to keep the ACF flexible and repeater field synchronization option disabled on the page until we find an optimal solution or workaround for the issue.

I will surely inform you when I receive any update from the 2nd tier team.

Thank you for your patience and kind cooperation.

Best regards,
Prosenjit