Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single product page gives Fatal Error on MOBILE DEVICES #46

Open
usmanmumtaz opened this issue Mar 21, 2024 · 0 comments
Open

Single product page gives Fatal Error on MOBILE DEVICES #46

usmanmumtaz opened this issue Mar 21, 2024 · 0 comments

Comments

@usmanmumtaz
Copy link
Contributor

Single product page gives Fatal Error on MOBILE DEVICES if $categories of that product is null in FacebookWordpressWooCommerce.php
.
Error message:

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /srv/htdocs/wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWooCommerce.php:126

Stack Trace
1.	
count(false)
/srv/htdocs/wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWooCommerce.php:126
2.	
FacebookPixelPlugin\Integration\FacebookWordpressWooCommerce::getProductCategory(4466)
/srv/htdocs/wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWooCommerce.php:116
3.	
FacebookPixelPlugin\Integration\FacebookWordpressWooCommerce::createViewContentEvent(Object(WC_Product_Variable))
[internal function]:0
4.	
call_user_func_array(Array, Array)
/srv/htdocs/wp-content/plugins/official-facebook-pixel/core/ServerEventFactory.php:203
5.	
FacebookPixelPlugin\Core\ServerEventFactory::safeCreateEvent('ViewContent', Array, Array, 'woocommerce')
/srv/htdocs/wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWooCommerce.php:96
6.	
FacebookPixelPlugin\Integration\FacebookWordpressWooCommerce::trackViewContentEvent('')
/wordpress/core/6.4.3/wp-includes/class-wp-hook.php:324
7.	
WP_Hook->apply_filters(NULL, Array)
/wordpress/core/6.4.3/wp-includes/class-wp-hook.php:348
8.	
WP_Hook->do_action(Array)
/wordpress/core/6.4.3/wp-includes/plugin.php:517
9.	
do_action('woocommerce_aft...')
/srv/htdocs/wp-content/plugins/elementor-pro/modules/woocommerce/documents/product.php:123
10.	
ElementorPro\Modules\Woocommerce\Documents\Product->after_get_content()
/srv/htdocs/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php:160
11.	
ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document->get_content()
/srv/htdocs/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php:173
12.	
ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document->print_content()
/srv/htdocs/wp-content/plugins/elementor-pro/modules/theme-builder/documents/single-base.php:93
13.	
ElementorPro\Modules\ThemeBuilder\Documents\Single_Base->print_content()
/srv/htdocs/wp-content/plugins/elementor-pro/modules/woocommerce/documents/product.php:133
14.	
ElementorPro\Modules\Woocommerce\Documents\Product->print_content()
/srv/htdocs/wp-content/plugins/elementor-pro/modules/theme-builder/classes/locations-manager.php:364
15.	
ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager->do_location('single')
/srv/htdocs/wp-content/plugins/elementor-pro/modules/theme-builder/classes/locations-manager.php:240
16.	
ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager->ElementorPro\Modules\ThemeBuilder\Classes\{closure}()
[internal function]:0
17.	
call_user_func(Object(Closure))
/srv/htdocs/wp-content/plugins/elementor/modules/page-templates/module.php:207
18.	
Elementor\Modules\PageTemplates\Module->print_content()
/srv/htdocs/wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php:19
19.	
include('/srv/htdocs/wp-...')
/wordpress/core/6.4.3/wp-includes/template-loader.php:106
20.	
require_once('/wordpress/core...')
/wordpress/core/6.4.3/wp-blog-header.php:19
21.	
require('/wordpress/core...')
/wordpress/core/6.4.3/index.php:17
22.	
{main}
thrown in /srv/htdocs/wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWooCommerce.php on line 126

.
I have fixed this issue and opened a Pull Request. Please accept that Pull Request and close this issue.
Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant