Skip to content

[BUG] ValueError: str_decrement(): Argument #1 ($string) cannot be empty #4911

@alexh-swdev

Description

@alexh-swdev

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The current Zend_Date fails to "str_decrement" when loading (some) products:

ValueError: str_decrement(): Argument #1 ($string) cannot be empty in /app/vendor/shardj/zf1-future/library/Zend/Date.php:2514
Stack trace:
#0 /app/vendor/shardj/zf1-future/library/Zend/Date.php(2514): str_decrement('')
#1 /app/vendor/shardj/zf1-future/library/Zend/Date.php(1003): Zend_Date->_calculate('set', '0000-00-00 00:0...', 'yyyy-MM-dd HH:m...', 'de_DE')
#2 /app/vendor/shardj/zf1-future/library/Zend/Date.php(197): Zend_Date->set('0000-00-00 00:0...', 'yyyy-MM-dd HH:m...', 'de_DE')
#3 /app/app/code/core/Mage/Core/Model/Locale.php(540): Zend_Date->__construct('0000-00-00 00:0...', 'yyyy-MM-dd HH:m...', Object(Zend_Locale))
#4 /app/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php(66): Mage_Core_Model_Locale->storeDate(NULL, '0000-00-00 00:0...', true, 'yyyy-MM-dd HH:m...')
#5 /app/app/code/core/Mage/Eav/Model/Entity/Abstract.php(630): Mage_Eav_Model_Entity_Attribute_Backend_Time_Created->afterLoad(Object(Mage_Catalog_Model_Product))
#6 /app/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1601): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/afterLo...', Array)
#7 /app/app/code/core/Mage/Eav/Model/Entity/Abstract.php(931): Mage_Eav_Model_Entity_Abstract->_afterLoad(Object(Mage_Catalog_Model_Product))
#8 /app/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(727): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), '25255', NULL)
#9 /app/app/code/core/Mage/Core/Model/Abstract.php(278): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Product), '25255', NULL)

This breaks at least some API calls

Expected Behavior

The previous Zend-Version shipped with OM 20.13.0 did not use str_decrement, same API calls don't fail.
I guess with the current Zend version, additional checks for valid values are required.

Steps To Reproduce

.

Environment

- OpenMage: 20.15.0
- php: 8.3

Anything else?

I don't know how those products with 0000-00-00 00:00:00 got created pre 2013-03-xx (That's the latest "changed date")

I think I am gonna set them to 1970-01-01 00:00:00 which should work around this issue

/Edit:
Similar issues e.g. for customers which results in a failure to load the backend customer settings

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions