#StackBounty: #magento-1.9 #configurable-product #image #swatches #labels Warning: array_merge_recursive() expects at least 1 parameter…

Bounty: 50

Warning: array_merge_recursive() expects at least 1 parameter, 0 given  in /home/WEBSERVER/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336

#0 [internal function]: mageCoreErrorHandler(2, 'array_merge_rec...', '/home/WEBSERVER/...', 336, Array)
#1 [internal function]: array_merge_recursive()
#2 /home/WEBSERVER/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php(336): call_user_func_array('array_merge_rec...', Array)
#3 /home/WEBSERVER/public_html/app/design/frontend/neighborhood/default/template/catalog/product/view/media.phtml(128): Mage_ConfigurableSwatches_Helper_Productimg->filterImageInGallery(Object(Amasty_Setimg_Model_Catalog_Product), Object(Varien_Object))
#4 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/WEBSERVER/...')
#5 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/neighb...')
#6 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#7 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#8 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#9 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('media', true)
#10 /home/WEBSERVER/public_html/app/design/frontend/neighborhood/default/template/catalog/product/view.phtml(80): Mage_Core_Block_Abstract->getChildHtml('media')
#11 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/WEBSERVER/...')
#12 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/neighb...')
#13 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#15 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#16 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Text_List->_toHtml()
#17 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#18 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#19 /home/WEBSERVER/public_html/app/design/frontend/neighborhood/default/template/page/2columns-right.phtml(62): Mage_Core_Block_Abstract->getChildHtml('content')
#20 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/WEBSERVER/...')
#21 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/neighb...')
#22 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#23 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#24 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#25 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#26 /home/WEBSERVER/public_html/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#27 /home/WEBSERVER/public_html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(SkyMagento_Redirect_IndexController), 'no-route')
#28 /home/WEBSERVER/public_html/app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(SkyMagento_Redirect_IndexController), 'no-route')
#29 /home/WEBSERVER/public_html/app/code/local/SkyMagento/Redirect/controllers/IndexController.php(15): Mage_Cms_IndexController->noRouteAction(NULL)
#30 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): SkyMagento_Redirect_IndexController->noRouteAction()
#31 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#32 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#33 /home/WEBSERVER/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#34 /home/WEBSERVER/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#35 /home/WEBSERVER/public_html/index.php(120): Mage::run(‘STORE_NAME’, 'store')
#36 {main}

I have a product with 5 images, one of which has a label that says “alt” – this works with our theme to enable this as the “hover” image for that product.

There are no images being used as configurable swatches. No other images have labels saved in them.

I have made sure there are no store specific settings saved.

I have reindexed and cleared my cache.

I have seen that other product updates are being made and not affected by this issue.

The section of code being referenced by this error is:

public function filterImageInGallery($product, $image)
    {
        if (!Mage::helper('configurableswatches')->isEnabled()) {
            return true;
        }

        if (!isset($this->_productImageFilters[$product->getId()])) {
            **LINE 336** $mapping = call_user_func_array("array_merge_recursive", $product->getChildAttributeLabelMapping()); ** END LINE **
            $filters = array_unique($mapping['labels']);
            $filters = array_merge($filters, array_map(function ($label) {
                return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX;
            }, $filters));
            $this->_productImageFilters[$product->getId()] = $filters;
        }

        return !in_array(Mage_ConfigurableSwatches_Helper_Data::normalizeKey($image->getLabel()),
            $this->_productImageFilters[$product->getId()]);
    }


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.