magento2
magento2 copied to clipboard
Magento 2.3.4 - Category getImageUrl() returns incorrect value
Preconditions (*)
- Magento 2.3.5-p1 (reproduced only on composer versions)
Steps to reproduce (*)
- Go to Admin->Catalog->Categories;
- Create a new category with an image;
- Go to Storefront and open created before the category
Expected result (*)
- Category image src uses the full URL
Actual result (*)
- Category image src is actually just a relative path
Additional Info
When uploading an image to categories, it would be expected that when loaded on the frontend the category image URL is loaded so that when the media URL is set (i.e. for CDN usage) - the full URL is used to load the image. This is not the case however because of a change introduced in commit 3c3acd75674039f38ee65d81e8daaa9cbb81fadb where it attempts to determine the path of the image value either being relative or absolute. Considering the backend model for the image attribute is using what would be considered an absolute path, it is simply returning the value without prepending the media URL to the file path.