-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Added GetAssetIdByContentFieldInterface and implementations #29058
Added GetAssetIdByContentFieldInterface and implementations #29058
Conversation
Hi @gabrieldagama. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
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.
Thanks for the PR @gabrieldagama ! Looks nice! Please see my comments
app/code/Magento/MediaContentCms/Model/GetAssetIdByContentField.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContentCms/Model/GetAssetIdByContentField.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContentApi/Model/GetAssetIdByContentFieldInterface.php
Outdated
Show resolved
Hide resolved
@magento run all tests |
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.
Thanks for updates @gabrieldagama ! Looks nice! Please checkout my review comments
app/code/Magento/MediaContentApi/Api/GetAssetIdByContentFieldInterface.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContent/Model/GetAssetIdByContentFieldComposite.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContentCatalog/Model/GetAssetIdByCategoryStore.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContent/Model/GetAssetIdByContentFieldComposite.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContentApi/Model/GetAssetIdByContentFieldInterface.php
Outdated
Show resolved
Hide resolved
...ation/testsuite/Magento/MediaContentCms/Model/ResourceModel/GetAssetIdByContentFieldTest.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContentCatalog/Model/GetAssetIdByEavContentField.php
Outdated
Show resolved
Hide resolved
app/code/Magento/MediaContentCatalog/Model/GetAssetIdByEavContentField.php
Outdated
Show resolved
Hide resolved
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.
Thanks for updates @gabrieldagama ! Please see my review comments
throw new InvalidArgumentException(__('The field argument is invalid.')); | ||
} | ||
$ids = []; | ||
/** @var GetAssetIdsByContentFieldInterface $fieldHandlers */ |
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.
unnecessary annotation (the type is already declared on property)
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.
I will actually update the property, that is not correct, it is a multidimensional array, instead of an array of GetAssetIdsByContentFieldInterface.
app/code/Magento/MediaContentApi/Model/Composite/GetAssetIdsByContentField.php
Outdated
Show resolved
Hide resolved
)->where( | ||
'entity_id IN (?)', | ||
$categoryIds | ||
); |
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.
Can we simplify the algorithm and abovid additional query to retrieve the category ids?
)->where( | |
'entity_id IN (?)', | |
$categoryIds | |
); | |
)->where( | |
'path like ?', | |
$storeGroup->getRootCategoryId() . '%' | |
); |
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.
Nice catch, I guess it looks way better now, thanks!
@magento run all tests |
@magento run all tests |
Hi @sivaschenko, thank you for the review.
|
@magento run all tests |
This PR introduces a service that is covered by integration tests, QA activities are not necessary |
Hi @gabrieldagama, thank you for your contribution! |
Description (*)
Added GetAssetIdByContentFieldInterface and its implementation on MediaContent modules, that will allow Adobe Stock Integration to extend MediaGallery filter functionality.
Integration tests to be added.
Related Pull Requests
https://github.com/magento/partners-magento2-infrastructure/pull/10
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)