Published: January 21, 2019
Last updated:

Magento ‘Exception’ with message ‘Unsupported data type N’ in lib/Unserialize/Reader/ArrValue.php:88

After SUPEE-8788 patch Magento shows Cannot add the item to shopping cart. error message:
magento-shopping-cart-is-empty

 

The following is logged into exception.log:
exception 'Exception' with message 'Unsupported data type N' in includes/src/Unserialize_Reader_ArrValue.php:88
Stack trace:
#0 includes/src/Unserialize_Reader_Arr.php(102): Unserialize_Reader_ArrValue->read('N', ';')
#1 includes/src/Unserialize_Parser.php(53): Unserialize_Reader_Arr->read('N', ';')
#2 includes/src/Mage_Core_Helper_UnserializeArray.php(44): Unserialize_Parser->unserialize('a:7:{s:4:"type"...')
#3 includes/src/__checkout.php(27996): Mage_Core_Helper_UnserializeArray->unserialize('a:7:{s:4:"type"...')
#4 includes/src/__checkout.php(28170): Mage_Rule_Model_Abstract->getConditions()
#5 includes/src/__checkout.php(31075): Mage_Rule_Model_Abstract->validate(Object(Mage_Sales_Model_Quote_Address))
#6 includes/src/__checkout.php(31101): Mage_SalesRule_Model_Validator->_canProcessRule(Object(Mage_SalesRule_Model_Rule), Object(Mage_Sales_Model_Quote_Address))
#7 includes/src/Mage_SalesRule_Model_Quote_Freeshipping.php(74): Mage_SalesRule_Model_Validator->processFreeShipping(Object(Mage_Sales_Model_Quote_Item))
#8 includes/src/__checkout.php(35085): Mage_SalesRule_Model_Quote_Freeshipping->collect(Object(Mage_Sales_Model_Quote_Address))
#9 includes/src/__checkout.php(33436): Mage_Sales_Model_Quote_Address->collectTotals()
#10 includes/src/__default.php(10589): Mage_Sales_Model_Quote->collectTotals()
#11 app/code/core/Mage/Checkout/controllers/CartController.php(223): Mage_Checkout_Model_Cart->save()
#12 includes/src/__default.php(14333): Mage_Checkout_CartController->addAction()
#13 includes/src/__default.php(18814): Mage_Core_Controller_Varien_Action->dispatch('add')
#14 includes/src/__default.php(18344): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 includes/src/__default.php(21260): Mage_Core_Controller_Varien_Front->dispatch()

Cause

The problem is caused by bug in SUPEE-8788v1. Use version 2 of SUPEE-8788 which includes patch for lib/Unserialize/Parser.php and files under lib/Unserialize/Reader/

Solution

Uninstall SUPEE-8788 and install SUPEE-8788 version 2. See How to install SUPEE-8788 without SSH for detailed instructions.

If you have any difficulties with solving this problem or got a similar one, please let us know in comments below, so we can find the solution together.

Posted in: Troubleshooting

43 votes, 5.00 avg. rating (99% score)