marcW-9
Background of the issue:
I am trying to: After I update to 2.1.4 I receive Fatal error and web is broken. When I downgrade to 2.1.3 everything works again. In that classicmenu I'm just using get_field('icon', $item); inside wp_nav_menu_objects filter hook.
Symptoms:
[20-Aug-2024 09:13:24 UTC] PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112
Stack trace:
#0 [internal function]: WPMLFPObj::WPMLFP{closure}()
#1 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#2 [internal function]: WPMLFPObj::WPMLFP{closure}()
#3 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array()
#4 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php(90): WPMLFPObj::__callStatic()
#5 [internal function]: WPMLFPObj::WPMLFP{closure}()
#6 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#7 [internal function]: WPMLFPObj::WPMLFP{closure}()
#8 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array()
#9 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Relation.php(50): WPMLFPObj::__callStatic()
#10 [internal function]: WPMLFPRelation::WPMLFP{closure}()
#11 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#12 [internal function]: WPMLFP{closure}()
#13 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Arr.php(147): call_user_func()
#14 /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(386): WPMLCollectSupportArr::first()
#15 /wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php(282): WPMLCollectSupportCollection->first()
#16 /wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php(262): WPML_ACF_Options_Page::isValidOptionPagePostId()
#17 /wp-includes/class-wp-hook.php(326): WPML_ACF_Options_Page->append_language_code_for_option_pages()
#18 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
#19 /wp-content/plugins/advanced-custom-fields-pro/includes/api/api-helpers.php(2208): apply_filters()
#20 /wp-content/plugins/advanced-custom-fields-pro/includes/api/api-template.php(20): acf_get_valid_post_id()
#21 /wp-content/themes/xxx/blocks/classicmenu/index.php(184): get_field()
#22 /wp-includes/class-wp-hook.php(324): {closure}()
#23 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
#24 /wp-includes/nav-menu-template.php(234): apply_filters()
#25 /wp-content/themes/xxx/blocks/classicmenu/render.php(58): wp_nav_menu()
#26 /wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(738): include('...')
#27 /wp-includes/class-wp-hook.php(324): acf_block_render_template()
#28 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#29 /wp-includes/plugin.php(517): WP_Hook->do_action()
#30 /wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(712): do_action()
#31 /wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(610): acf_render_block()
#32 /wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(533): acf_rendered_block()
#33 /wp-includes/class-wp-block.php(519): acf_render_block_callback()
#34 /wp-includes/class-wp-block.php(499): WP_Block->render()
#35 /wp-includes/class-wp-block.php(499): WP_Block->render()
#36 /wp-includes/class-wp-block.php(499): WP_Block->render()
#37 /wp-includes/blocks.php(2061): WP_Block->render()
#38 /wp-includes/blocks.php(2113): render_block()
#39 /wp-includes/blocks/template-part.php(154): do_blocks()
#40 /wp-content/plugins/woocommerce/src/Blocks/BlockTemplatesController.php(117): render_block_core_template_part()
#41 /wp-includes/class-wp-block.php(519): AutomatticWooCommerceBlocksBlockTemplatesController->render_woocommerce_template_part()
#42 /wp-includes/blocks.php(2061): WP_Block->render()
#43 /wp-includes/blocks.php(2113): render_block()
#44 /wp-includes/block-template.php(263): do_blocks()
#45 /wp-includes/template-canvas.php(12): get_the_block_template_html()
#46 /wp-includes/template-loader.php(106): include('...')
#47 /wp-blog-header.php(19): require_once('...')
#48 /index.php(17): require('...')
#49 {main}
thrown in /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php on line 112
Questions:
Why do I receive a fatal error after updating to Advanced Custom Fields Multilingual v2.1.4?
How can I resolve the fatal error and prevent the web from breaking?
Is there a compatibility issue between Advanced Custom Fields Multilingual v2.1.4 and WPML?
Noman
When we spot a compatibility conflict we need to replicate it at a fresh WP site in order to escalate it to our compatibility team. Could you please help me to replicate the issue at fresh WP site by following the below steps:
1. Please login to the fresh WP site by clicking on the auto login URL: hidden link
2. Please configure the ACF plugin as you did on your site.
3. Please try to reproduce the issue and let me know the steps which you have followed to replicate this issue.
Please note that we only need above mentioned plugin functionality, you don't need to set up an entire website or clone your existing site.
Thank you
marcW-9
It will only happen when menu contains language switcher, so item that is instance of WPML_LS_Menu_Item
So here is the menu:
hidden link
Here is language switcher:
hidden link
You can see ACF field in here:
hidden link
Here is the snippet to output icons:
hidden link
Here you can see the broken site:
hidden link
When you downgrade to Advanced Custom Fields Multilingual 2.1.3 then everything works.
Pierre Sylvestre
Supporter
Languages:
English (English )
French (Français )
Portuguese (Brazil) (Português )
Timezone:
America/Sao_Paulo (GMT-03:00)
Hi @marcW-9 ,
Thanks for reporting this issue.
We'll release a patch version in short.
Meanwhile you can try the patch suggested on https://wpml.org/forums/topic/website-offline-wpml_acf_options_page-append_language_code_for_option_pageswpml-ls-2-de/#post-16087104 , or just keep ACFML 2.1.3 and wait for the next patch.
Thanks again,
Pierre
Noman
Thank you once again for reporting this issue.
We have published an errata for this problem here:
https://wpml.org/errata/advanced-custom-fields-uncaught-symfonycomponentdebugexceptionfatalthrowableerror-call-to-undefined-function-acf_get_options_pages/
I kindly ask you to take a backup of your site and try the suggested workaround in the errata. Please let us know if this resolves the issue.
We appreciate your patience and cooperation.
Thank you