AnonSimba Posted June 4, 2023 Share Posted June 4, 2023 Hi Team, getting the following error while opening any product Fatal error: Uncaught TypeError: Return value of ProductAssemblerCore::addMissingProductFields() must be of the type array, null returned in /home/simba/simbaweb.com/classes/ProductAssembler.php:111 Stack trace: #0 /home/simba/simbaweb.com/classes/ProductAssembler.php(125): ProductAssemblerCore->addMissingProductFields(Array) #1 /home/simba/simbaweb.com/modules/ps_viewedproduct/ps_viewedproduct.php(253): ProductAssemblerCore->assembleProduct(Array) #2 /home/simba/simbaweb.com/modules/ps_viewedproduct/ps_viewedproduct.php(195): Ps_Viewedproduct->getViewedProducts(36) #3 /home/simba/simbaweb.com/modules/ps_viewedproduct/ps_viewedproduct.php(181): Ps_Viewedproduct->getWidgetVariables('displayFooterPr...', Array) #4 /home/simba/simbaweb.com/classes/Hook.php(994): Ps_Viewedproduct->renderWidget('displayFooterPr...', Array) #5 /home/simba/simbaweb.com/classes/Hook.php(938): HookCore::coreRenderWidget(Object(Ps_Viewedproduct), 'displayFooterPr...', Array) #6 /home/zp in /home/simba/simbaweb.com/classes/ProductAssembler.php on line 111 PrestaShop version: 8.0.4 theme revostore Version 1.0.7 Link to comment Share on other sites More sharing options...
ComGrafPL Posted June 4, 2023 Share Posted June 4, 2023 What's your PHP? Is that theme is updated to work on PS 8? Temporary disable this module "ps_viewedproduct", clear cache and check. 1 Link to comment Share on other sites More sharing options...
EnriqueCastroRodrigu Posted June 7, 2023 Share Posted June 7, 2023 I have the same issue. PHP version 7.4 and running in "FPM application" mode. Prestashop v. 1.7.8.8 Uncaught TypeError: Return value of ProductAssemblerCore::addMissingProductFields() must be of the type array, null returned in /var/www/vhosts/xxxxx.es/httpdocs/classes/ProductAssembler.php:111 Stack trace: #0 /var/www/vhosts/xxxxx.es/httpdocs/classes/ProductAssembler.php(125): ProductAssemblerCore->addMissingProductFields() #1 /var/www/vhosts/xxxxx.es/httpdocs/modules/creativeelements/includes/base/widget-product-base.php(2360): ProductAssemblerCore->assembleProduct() #2 /var/www/vhosts/xxxxxx.es/httpdocs/modules/creativeelements/includes/base/widget-product-base.php(2406): CE\WidgetProductBase->getProduct() #3 /var/www/vhosts/xxxxxx.es/httpdocs/modules/creativeelements/includes/widgets/product-grid.php(289): CE\WidgetProductBase->getProducts() #4 /var/www/vhosts/xxxxxxx.es/httpdocs/modules/creativeelements/includes/base/widget-base.php(512): CE\WidgetProductGrid->render() #5 /var/www/vhosts/xxxxxxx.es/httpdocs/modules/creativeelements/includes/base/widget-base.php(646): CE\WidgetBase->renderContent Link to comment Share on other sites More sharing options...
walidkira Posted January 12, 2024 Share Posted January 12, 2024 (edited) Hi , When this error occurs in my shop, I come up with this solution. In ProductAssembler.php:111, make this changes. if ($rows === false) { return $rawProduct; } // **** $mergedData = array_merge($rows[0], $rawProduct); if (!is_array($mergedData)) { throw new Exception("La méthode addMissingProductFields doit retourner un tableau."); } return $mergedData; // ******** } Edited January 16, 2024 by walidkira (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now