Looking at your site, it turns out one of your WPML plugins is swapping the standard WP_Post object with their own WPML_LS_Menu_Item object during retrieval of your menu items. Because our plugin expects menu items to be of the standard type, the following error was being thrown:
PHP Fatal error: Uncaught TypeError: Advanced_Sidebar_Menu\Nav_Menu\Item::factory(): Argument #1 ($menu_item) must be of type WP_Post, WPML_LS_Menu_Item given, called in /usr/www/users/colmcc/live/wp-content/plugins/advanced-sidebar-menu-pro/src/Nav_Menu/Objects.php on line 305
I was able to remove the strict type checking in our plugin for this particular use case and the page and widget are now loading.
I have also added this change directly to our plugin, which will go out with the next release.
I’ve reactivated the plugin and looked at both provided pages and I don’t see the widget on the page, nor do I see any errors. It’s likely the page was saved when our plugin was deactivate, which would remove the widget.
Looking at your error log, I see a ton of errors from other plugins but nothing related to our plugin. The most prominent error I see is being thrown inside “yootheme”:
[28-May-2021 10:39:31 UTC] PHP Fatal error: Uncaught TypeError: array_pop(): Argument #1 ($array) must be of type array, null given in /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress/elements/module/element.php:45
Stack trace:
#0 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress/elements/module/element.php(45): array_pop()
#1 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(289): YOOtheme\Configuration\Resolver->YOOtheme\{closure}()
#2 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(274): YOOtheme\Builder->applyTransforms()
#3 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(274): YOOtheme\Builder->applyTransforms()
#4 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(274): YOOtheme\Builder->applyTransforms()
#5 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(274): YOOtheme\Builder->applyTransforms()
#6 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(95): YOOtheme\Builder->applyTransforms()
#7 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder/src/Builder.php(112): YOOtheme\Builder->load()
#8 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress-source/src/TemplateListener.php(47): YOOtheme\Builder->render()
#9 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/view/src/View/SectionHelper.php(47): YOOtheme\Builder\Wordpress\Source\TemplateListener::YOOtheme\Builder\Wordpress\Source\{closure}()
#10 [internal function]: YOOtheme\View\SectionHelper->YOOtheme\View\{closure}()
#11 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/view/src/View/SectionHelper.php(53): array_reduce()
#12 [internal function]: YOOtheme\View\SectionHelper->get()
#13 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/view/src/View.php(86): call_user_func_array()
#14 /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/theme-wordpress/functions.php(16): YOOtheme\View->__call()
#15 /usr/www/users/colmcc/live/wp-content/themes/yootheme/page.php(19): YOOtheme\get_section()
#16 /usr/www/users/colmcc/live/wp-includes/template-loader.php(106): include(‘/usr/www/users/…’)
#17 /usr/www/users/colmcc/live/wp-blog-header.php(19): require_once(‘/usr/www/users/…’)
#18 /usr/www/users/colmcc/live/index.php(17): require(‘/usr/www/users/…’)
#19 {main}
thrown in /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress/elements/module/element.php on line 45
I’m afraid the theme editor won’t let me see the file in question, so I can’t offer more information on the origin of the error.
To allow you to continue to work, maybe you can create a test page which has the widget and the error, so we can investigate further. Also, if you can send us the contents of the above file, we can likely point you in right direction of fixed that error.
Looking at your log, it appears the error is being caused by a call within one of your theme files.
PHP Fatal error: Uncaught TypeError: array_pop(): Argument #1 ($array) must be of type array, null given in /usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress/elements/module/element.php:45
Because there are no direct calls to any methods within our plugin, I can’t determine the cause from the logs. Most likely there is a call within the theme file which uses a filter the widget taps into. Since this could be 1 of about 60 filters, I would need more information to determine a fix.
If you are able to send me the contents of the file in question, I can certainly take a look and will likely be able to either patch the theme file or adjust our plugin in some way to allow the your theme and our plugin to work together.
Hi David,
Looking at your site, it turns out one of your WPML plugins is swapping the standard
WP_Post
object with their ownWPML_LS_Menu_Item
object during retrieval of your menu items. Because our plugin expects menu items to be of the standard type, the following error was being thrown:I was able to remove the strict type checking in our plugin for this particular use case and the page and widget are now loading.
I have also added this change directly to our plugin, which will go out with the next release.
Have a great night!
Thanks for that, WPML is a pretty major plugin. The issue is still there when switching language, see:
David
I’ve disabled the plugin so we can work on the website but feel free to enable it to test.
Hi David,
I’ve reactivated the plugin and looked at both provided pages and I don’t see the widget on the page, nor do I see any errors. It’s likely the page was saved when our plugin was deactivate, which would remove the widget.
Looking at your error log, I see a ton of errors from other plugins but nothing related to our plugin. The most prominent error I see is being thrown inside “yootheme”:
I’m afraid the theme editor won’t let me see the file in question, so I can’t offer more information on the origin of the error.
/usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress/elements/module/element.php
To allow you to continue to work, maybe you can create a test page which has the widget and the error, so we can investigate further. Also, if you can send us the contents of the above file, we can likely point you in right direction of fixed that error.
Have a great weekend!
Thanks for checking, I’ve re-enabled everything and see the error again.
Hi David,
Looking at your log, it appears the error is being caused by a call within one of your theme files.
Because there are no direct calls to any methods within our plugin, I can’t determine the cause from the logs. Most likely there is a call within the theme file which uses a filter the widget taps into. Since this could be 1 of about 60 filters, I would need more information to determine a fix.
If you are able to send me the contents of the file in question, I can certainly take a look and will likely be able to either patch the theme file or adjust our plugin in some way to allow the your theme and our plugin to work together.
/usr/www/users/colmcc/live/wp-content/themes/yootheme/vendor/yootheme/builder-wordpress/elements/module/element.php
Have a great rest of your weekend!
I forget to mention, if you prefer to send me FTP access, I can also see the file in question that way.