Open
Description
Preconditions (*)
- Magento 2.4.2 / 2.4.3
- Magento 2.3.x
- Multistore installation with following setup:
-- store nr 1 has different URLs for media
-- store nr 2 has only secured URL for media different - set secure URLs to be used in frontend
Steps to reproduce (*)
- create a CLI method to iterate through all the stores and try to fetch main product image for each store
/** @var \Magento\Store\Api\Data\StoreInterface $store */
foreach ($this->storeManager->getStores() as $store) {
foreach ($this->storeManager->getStores() as $store) {
// force store emulation for helpers and image getters
$this->appEmulation->startEnvironmentEmulation($store->getId(), \Magento\Framework\App\Area::AREA_FRONTEND, true);
- fetch product collection
- display product image using
imageHelper
class - to make it easier, use the code from sitemap generation
/**
* Get product image URL from image filename
*
* @param string $image
* @return string
*/
private function getProductImageUrl(string $image): string
{
return $this->imageUrlBuilder->getUrl($image, 'product_page_image_large');
}
Expected result (*)
- image URLs for all product images are per configured URL
Actual result (*)
- Media URL for each product is set to the default one
Source of the issue (*)
- in this file
vendor/magento/module-catalog/Model/Product/Media/Config.php
there is noisSecure
check - so it returns the same media URLs for all products
Solution (*)
- issue can be solved with proper store configuration
- introduce code fix to check if secure frontend is used for that media path
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchIssue related to Developer Experience and needs help with Triage to Confirm or Reject it