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

Add support for prefixed tables in Magento 2.3.1? #38

Open
YachYaroslav opened this issue Jun 12, 2019 · 5 comments
Open

Add support for prefixed tables in Magento 2.3.1? #38

YachYaroslav opened this issue Jun 12, 2019 · 5 comments

Comments

@YachYaroslav
Copy link

When trying to use php bin/magento eav:media:remove-unused I see the next error: Base table or view not found: 1146 Table 'store.catalog_product_entity_media_gallery' doesn't exist, query was: SELECT value FROM catalog_product_entity_media_gallery WHERE value = ?.

@ThomasNegeli
Copy link

@YachYaroslav did you check that the table in your DB really exists?

@YachYaroslav YachYaroslav changed the title Add support for Magento 2.3.1 Add support for prefixed tables in Magento 2 Jun 12, 2019
@YachYaroslav
Copy link
Author

YachYaroslav commented Jun 12, 2019

I know the reason, when the store use prefix for tables it doesn't work.

@YachYaroslav
Copy link
Author

For example:

зображення

@YachYaroslav
Copy link
Author

@YachYaroslav did you check that the table in your DB really exists?

So, table exists, but with prefix.

@YachYaroslav
Copy link
Author

Changing of

$mediaGallery = $resource->getConnection()->getTableName('catalog_product_entity_media_gallery');

to

$setup = $objectManager->get('Magento\Framework\Setup\ModuleDataSetupInterface');
$mediaGallery = $setup->getTable('catalog_product_entity_media_gallery');

helped me in EAVCleaner/Console/Command/RemoveUnusedMediaCommand.php.

@YachYaroslav YachYaroslav changed the title Add support for prefixed tables in Magento 2 Add support for prefixed tables in Magento 2.3.1? Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants