-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Magento 2.3.1: Catalog setup fails with error "Magento\Catalog\Setup\Media does not exist" #22124
Comments
Hi @nussjustin. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @nussjustin do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
|
Nice find @nussjustin! Issue seems to have been introduced in dcd8b32#diff-7b8ac6c93b8d79968c8d4d8237621404L587 (I'm wondering why the tests didn't catch this...) Would you be willing to create a Pull Request with a fix for this? |
After looking at it again, I'm not sure what the correct fix would be. In Magento 2.2 there was some kind of mapping in the di.xml This was removed in 2.3.1 at it seems, so just using |
maybe the author of the mentioned commit has an answer for this, @rganin ? |
This functionality does not seem to be a part of Magento Open Source, isn't it? In such case
|
@orlangur he may have used the enterprise, but the error is in Magento_Catalog, which is in Open Source... |
@renttek it does not matter, it's quite a frequent situation that enterprise issues require fixes in community modules. This issue can be reopened if it is reproducible on a Magento Open Source. Otherwise it just cannot be reproduced and fixed by Community members. |
I can understand this reasoning, but this is literally a basic 'could be catched by an IDE' php coding error, in a an OS module, introduced by @rganin withint commit dcd8b32 (Which references "MAGETWO-87551") @nussjustin maybe you should just open another issue with the CE m( |
@renttek man, do you hear me? :) There is no need to open another one. @nussjustin @hostep @renttek could please anyone confirm it is reproducible on Magento Open Source? I really doubt this wasn't tested prior to release but reopening in advance. |
@nussjustin: thanks for pointing out that If I take a look at the database, in the table The correct fix here would probably be to remove the backend model in the @orlangur: I don't know how to reproduce the error @nussjustin sees. But this is a code smell, and it would be nice if this could get cleaned up I think. |
Agree on that, @nussjustin for the reproduction would be nice if you figure out what causes a problem in one of Magento Commerce modules, maybe provide an isolated case as a small module just for revealing issue. |
I'm currently unable to reproduce with a fresh Magento 2 (with sample data, both when installing 2.3.1 directly and when upgrading from 2.3.0 to 2.3.1) both CE and EE, but consistently with a copy of one of our customers M2 EE installations. This problem is currently preventing us from upgrading one of our customers sites from 2.3.0 EE to 2.3.1 EE. |
@nussjustin probably this is not true for this one customer? As a workaround just create a dummy |
@orlangur The backend_model for media_gallery is NULL for this customer. Creating an empty class Media that extends AbstractBackend worked, thanks. The backend_model is still NULL in the eav_attribute table, but everything works. |
Hi @nussjustin. Thank you for your report. The fix will be available with the upcoming 2.3.2 release. |
Preconditions
Exact PHP version:
Steps to reproduce
bin/magento setup:upgrade
Expected result
Actual result
Class Magento\Catalog\Setup\Media does not exist
when runningData install/update
forMagento_Catalog
This seems to be a bug in the
CategorySetup.php
:https://github.com/magento/magento2/blob/4a28abb/app/code/Magento/Catalog/Setup/CategorySetup.php#L629
This should probably be
\Magento\Catalog\Model\Product\Attribute\Backend\Media::class
or ause \Magento\Catalog\Model\Product\Attribute\Backend\Media
be added at the beginning of the file.The text was updated successfully, but these errors were encountered: