Skip to content

Magento 2.3.4 - Category getImageUrl() returns incorrect value #28100

Open
@jkenneydaniel

Description

@jkenneydaniel

Preconditions (*)

  1. Magento 2.3.5-p1 (reproduced only on composer versions)

Steps to reproduce (*)

  1. Go to Admin->Catalog->Categories;
  2. Create a new category with an image;
  3. Go to Storefront and open created before the category

Expected result (*)

  1. Category image src uses the full URL

Actual result (*)

  1. 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 3c3acd7 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.

Example from Magento 2.3.4 with Sample Data

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CatalogComponent: CatalogComponent: ImageComponent: UrlIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReported on 2.3.5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions