-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Fixed undefined array key "values" in Mage_Catalog_Model_Product_Attribute_Backend_Media #4125
Conversation
Removed unnecessary 'includes' folder, because Compiler was removed lately
This reverts commit 18ff2d6.
fix undefined array key "values" in /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 113 and fixed foreach() argument must be of type array|object, null given in /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 167
I have a simmilar PR pending, |
I just followed the rest of the code (see few lines of code above where |
Prior to php7.4 it was far slower. I'd not follow it anymore. Have a read ... Same for |
May I ask where this error comes from? Seems to be 3rd-party code. (?) |
Yes, errors may come from 3rd-party code, the old module CommerceExtensions_Productimportexport for importing products via Dataflow Profiles. |
Can you post a stacktrace and maybe share it? However. Adding checks for existing array-key does not harm. |
Errors are in system.log. There are only these warnings there (repeating many times), but without stacktrace :-( |
Could you please fill out the template we use for PRs? |
You could temporarily add a "debug trap" like so:
In my above mentioned PR, the issue is coming from an old unused ama pay plugin. But nevertheless, imho the OM core should be able to handle such things in a proper way |
This reverts commit 8685a12.
Here is the result of the "debug trap". Softwex_Core_Model_Convert_Adapter_Productimport is my custom profile for importing products via Dataflow Advanced Profiles.
IMHO, I agree with @alexh-swdev, OpenMage core should be able to handle such things in a proper way... |
Imho checks for existing keys should be covered by OM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think it is bit different there, b/c there are additional checks to make sure the array-value is not null.
In this case we would pass null to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested.
There were still some warnings after product import without providing images additional data.
fixed undefined array key "values" in /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 113
and
fixed foreach() argument must be of type array|object, null given in /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 167.