Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when saving product with image without description #4134

Closed
MateusM3 opened this issue Jul 31, 2024 · 7 comments · Fixed by #4136
Closed

Error when saving product with image without description #4134

MateusM3 opened this issue Jul 31, 2024 · 7 comments · Fixed by #4136

Comments

@MateusM3
Copy link

The problem continues to occur, i noticed that it was fixed in the issue #4023 but, in the current version 20.10.2 it continues to happen

Preconditions (*)
OpenMage 20.10.2
PHP 8.2

Steps to reproduce (*)
Open the Catalog -> Create Product -> Upload Images -> with out description (label) -> Save

Expected result (*)
Saving the product with an empty label like previous versions, may be the version of PHP that is more careful regarding the array key not existing

### Actual result (*)

image

@MateusM3 MateusM3 added the bug label Jul 31, 2024
@empiricompany
Copy link
Contributor

empiricompany commented Jul 31, 2024

i cannot reproduce this issues

result

i've also tried with a new fresh product
result2

on latest OpenMage 10.10.2 / php 8.2

devmode is enabled and error level is setted to debug
devmode

devmode

devmode2

@empiricompany
Copy link
Contributor

Here you said the patch had fixed the problem #4023 (comment)

Mage_Catalog_Model_Product_Attribute_Backend_Media contains the patch?
https://github.com/OpenMage/magento-lts/pull/4024/files

i see in your composer update you have a package named k13/overwrite_customer_module_openmage
maybe this rewrite the class?

@MateusM3
Copy link
Author

It's not working here, about the module this module is private to another function, I'm debugging here and it enters the normal core class

One thing I noticed that you're doing differently is not selecting the "base image", "small image" and "thumb"

@empiricompany
Copy link
Contributor

It's not working here, about the module this module is private to another function, I'm debugging here and it enters the normal core class

One thing I noticed that you're doing differently is not selecting the "base image", "small image" and "thumb"

I think I also tried selecting the image as you say, but I'll try tomorrow better by making sure I do it

Have you checked if the class is updated correctly with the patch?

@sreichel
Copy link
Contributor

Looks like 3rd-party code. Please share a stacktrace ...

@empiricompany
Copy link
Contributor

Bug confirmed, steps to reproduce:

  1. Create a new product
  2. Add a new media image and mark it as the default image for Base Image, Small Image, and Thumbnail
  3. Save

Result:
Upon save, this error occurs (and the product is not saved):

2024-08-01T06:38:15+00:00 ERR (3):
Mage_Eav_Model_Entity_Attribute_Exception: Warning: Undefined array key "label_use_default"  in /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 170 in /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Core/Model/Config.php:1478
Stack trace:
#0 /shared/httpd/github-openmage/htdocs/app/Mage.php(542): Mage_Core_Model_Config->getModelInstance('eav/entity_attr...', 'Warning: Undefi...')
#1 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php(644): Mage::getModel('eav/entity_attr...', 'Warning: Undefi...')
#2 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1628): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/beforeS...', Array)
#3 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Catalog/Model/Resource/Product.php(167): Mage_Eav_Model_Entity_Abstract->_beforeSave(Object(Mage_Catalog_Model_Product))
#4 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1090): Mage_Catalog_Model_Resource_Product->_beforeSave(Object(Mage_Catalog_Model_Product))
#5 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Core/Model/Abstract.php(379): Mage_Eav_Model_Entity_Abstract->save(Object(Mage_Catalog_Model_Product))
#6 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(748): Mage_Core_Model_Abstract->save()
#7 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(424): Mage_Adminhtml_Catalog_ProductController->saveAction()
#8 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(255): Mage_Core_Controller_Varien_Action->dispatch('save')
#9 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(181): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /shared/httpd/github-openmage/htdocs/app/code/core/Mage/Core/Model/App.php(358): Mage_Core_Controller_Varien_Front->dispatch()
#11 /shared/httpd/github-openmage/htdocs/app/Mage.php(758): Mage_Core_Model_App->run(Array)
#12 /shared/httpd/github-openmage/htdocs/index.php(60): Mage::run('', 'store')
#13 {main}

screen

@empiricompany
Copy link
Contributor

@MateusM3 please review the patch in this PR #4136 if works for you

kiatng added a commit that referenced this issue Sep 2, 2024
…talog_Model_Product_Attribute_Backend_Media (#4136)

* fix issues 4134

* better code
Co-authored-by: kiatng

---------

Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants