Hi, I have a website that uses the dynamic.ooo plug-in (Dynamic Content for Elementor).
When I have the Dynamic Content plug-in active at the same time as Toolset plugin, and I try to access the Toolset settings page, I receive the following error. Based on the file-structure, it appears to be in the Dynamic plug-in, however, they said it was likely a problem on your end, regarding the "str_contains" function that is passed.
Can you get this fixed? Or, is it Dynamic's problem with the Symfony plugin that really needs to be solved? I don't mind being the middleman but I just need both plug-ins active at the same time.
The attached debug info is *only* from when the Dynamic plug-in is inactive, since it otherwise serves the Fatal error.
Fatal error: Uncaught TypeError: Argument 1 passed to str_contains() must be of the type string, null given, called in /home/artijyyg/ecr/wp-content/plugins/woocommerce-views/application/Helpers/Template_Settings_Translator.php on line 44 and defined in /home/artijyyg/ecr/wp-content/plugins/dynamic-content-for-elementor/vendor/symfony/polyfill-php80/bootstrap.php:29 Stack trace: #0 /home/artijyyg/ecr/wp-content/plugins/woocommerce-views/application/Helpers/Template_Settings_Translator.php(44): str_contains(NULL, '/home/artijyyg/...') #1 /home/artijyyg/ecr/wp-content/plugins/woocommerce-views/application/Settings/Sections/Legacy_Templates.php(64): WooViews\Helpers\Template_Settings_Translator->is_theme_template(NULL) #2 /home/artijyyg/ecr/wp-content/plugins/woocommerce-views/application/Settings/Frontend.php(88): WooViews\Settings\Sections\Legacy_Templates->is_enabled() #3 /home/artijyyg/ecr/wp-content/plugins/woocommerce-views/application/Settings/Frontend.php(62): WooViews\Settings\Frontend->register_sections() #4 /home/ in /home/artijyyg/ecr/wp-content/plugins/dynamic-content-for-elementor/vendor/symfony/polyfill-php80/bootstrap.php on line 29
Hi,
Thank you for contacting us and I'd be happy to assist.
Based on your report, I was able to reproduce this issue on my test website too.
When the “Dynamic Content for Elementor” and the “WooCommerce Blocks” plugins are active, a fatal error is shown when trying to access Toolset’s settings page.
I've shared these findings with the concerned team and will keep you updated through this ticket.
regards,
Waqar
Thanks for the update and I've heard back from the concerned team.
During the investigation, it turned out that this will need to be fixed on the "Dynamic Content for Elementor" plugin's side and should be reported to their official support team.
The plugin contains a polyfill for the function str_contains which is only available in PHP8. If you call str_contains with null as the first argument it will trigger a fatal error.
The same can be verified by disabling all plugins except for Dynamic Content for Elementor, and then adding the following line to the active theme's "functions.php" file:
str_contains( null, "some string" );
After that, loading any page will trigger the error, as the PHP8 function str_contains simply returns false when called the same way.
So in summary their polyfill needs to be fixed.
( we also include a polyfill that doesn't suffer from this problem, but when both plugins are active theirs is loaded first )
I hope this background information will help in your report to the plugin author.