0

I am experiencing some strange behaviors in an old magento 1.8.1.0 e-commerce. After 3 years of flawless savings magento stopped being able to update products. The machine seems to run fine (it is an Ubuntu 16.04.4 LTS with 31GB of space free).

Daily programmatically imports and backend updates on product seem not to throw any exception, however no data gets really updated both programmatically and from the backend UI (although it says "The product has been saved." no change gets really saved). Even small changes like just updating the product name.

The exception.log contains nothing, it seems that both magento backend and my custom scheduled import believe the update are saving fine as usual, however there's no change really saved.

The system.log however contains lot of error and warning of this kind for each product saved:

2020-09-08T14:05:43+00:00 DEBUG (7): Saving grouped product: A1347             
2020-09-08T14:05:43+00:00 ERR (3): Warning: Invalid argument supplied for foreach()  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1180
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1225 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 543
2020-09-08T14:05:43+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be of the type array, null given, called in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2020-09-08T14:05:43+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given  in /opt/bitnami/apache2/htdocs/XXX/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256

The cited lines contains these core data code blocks:

/**
 * Return if attribute exists in original data array.
 * Checks also attribute's store scope:
 * We should insert on duplicate key update values if we unchecked 'STORE VIEW' checkbox in store view.
 *
 * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
 * @param mixed $value New value of the attribute.
 * @param array $origData
 * @return bool
 */
protected function _canUpdateAttribute(
    Mage_Eav_Model_Entity_Attribute_Abstract $attribute,
    $value,
    array &$origData)
{
    $result = parent::_canUpdateAttribute($attribute, $value, $origData);
    if ($result &&
        ($attribute->isScopeStore() || $attribute->isScopeWebsite()) &&
        !$this->_isAttributeValueEmpty($attribute, $value) &&
        $value == $origData[$attribute->getAttributeCode()] &&
        isset($origData['store_id']) && $origData['store_id'] != $this->getDefaultStoreId()
    ) {
        return false;
    }

    return $result;
}

And this:

/**
 * Prepare entity object data for save
 *
 * result array structure:
 * array (
 *  'newObject', 'entityRow', 'insert', 'update', 'delete'
 * )
 *
 * @param   Varien_Object $newObject
 * @return  array
 */
protected function _collectSaveData($newObject)
{
    $newData   = $newObject->getData();
    $entityId  = $newObject->getData($this->getEntityIdField());

    // define result data
    $entityRow  = array();
    $insert     = array();
    $update     = array();
    $delete     = array();

    if (!empty($entityId)) {
        $origData = $newObject->getOrigData();
        /**
         * get current data in db for this entity if original data is empty
         */
        if (empty($origData)) {
            $origData = $this->_getOrigObject($newObject)->getOrigData();
        }

        /**
         * drop attributes that are unknown in new data
         * not needed after introduction of partial entity loading
         */
        foreach ($origData as $k => $v) {
            if (!array_key_exists($k, $newData)) {
                unset($origData[$k]);
            }
        }
    } else {
        $origData = array();
    }

How can I get more information where the problem is?

From my understating Magento started to have problems getting the original data of the objects and is not saving anymore any product update. Some other similiar question seems to point out that the problem is that the store_id is not set, however my scheduled import worked as expected for years and is updating information on specific store views.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.