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

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

Open
jkenneydaniel opened this issue May 4, 2020 · 51 comments
Open

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

jkenneydaniel opened this issue May 4, 2020 · 51 comments
Labels
Area: Catalog Component: Catalog Component: Image Component: Url Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.3.5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@jkenneydaniel
Copy link

jkenneydaniel commented May 4, 2020

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

@m2-assistant
Copy link

m2-assistant bot commented May 4, 2020

Hi @jkenneydaniel. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@jkenneydaniel do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label May 4, 2020
@jkenneydaniel
Copy link
Author

@magento give me 2.3.4 instance

@magento-engcom-team
Copy link
Contributor

Hi @jkenneydaniel. Thank you for your request. I'm working on Magento 2.3.4 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @jkenneydaniel, here is your Magento instance.
Admin access: https://i-28100-2-3-4.instances.magento-community.engineering/admin_e91c
Login: 6b29d693 Password: 0ed39ee02cc2
Instance will be terminated in up to 3 hours.

@jkenneydaniel
Copy link
Author

Confirmed the issue:
image

@engcom-Alfa engcom-Alfa self-assigned this May 7, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 7, 2020

Hi @engcom-Alfa. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Alfa
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @engcom-Alfa. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @engcom-Alfa, here is your Magento instance.
Admin access: https://i-28100-2-4-develop.instances.magento-community.engineering/admin_7c8f
Login: be299754 Password: 5d86697c07be
Instance will be terminated in up to 3 hours.

@engcom-Alfa
Copy link
Contributor

Hi @jkenneydaniel. Thank you for your reporting.

Unfortunately, we are not able to reproduce this issue on a fresh 2.4-develop instance.

Manual testing scenario:

  1. Add image to category;
  2. Go to Storefront-> Category with an image;
  3. Open dev tools;

Actual Result: ✔️ Category image src uses the full URL

image
image1

@jkenneydaniel Could you take a look?
Thanks!

@jkenneydaniel
Copy link
Author

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @jkenneydaniel. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @jkenneydaniel, here is your Magento instance.
Admin access: https://i-28100-2-4-develop.instances.magento-community.engineering/admin_7596
Login: ff9671ff Password: a51269174d52
Instance will be terminated in up to 3 hours.

@jkenneydaniel
Copy link
Author

@engcom-Alfa So I see in 2.4 the functionality for the image.phtml was changed to use the Image viewmodel: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/ViewModel/Category/Image.php

Which means that section no longer uses $category->getImageUrl() - however on 2.3 this is not the case - so I'm a little confused, will this issue not be fixed in 2.3 but rather we'll have to wait until after 2021 for 2.4 release?

@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented May 8, 2020

@jkenneydaniel The issue is reproducible on Magento 2.3.5-p1 composer version (reproduced only on composer versions).

Actual Result: ✖️ Category image src is actually just a relative path

newww
newwwwww

@engcom-Alfa engcom-Alfa added Component: Catalog Component: Image Component: Url Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 8, 2020
@ghost ghost unassigned engcom-Alfa May 8, 2020
@ghost ghost removed the Progress: ready for QA label May 8, 2020
@engcom-Delta engcom-Delta added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Reproduced on 2.3.5p1 Only if reproduced on 2.3.5p1 but not on 2.4-develop Progress: done labels May 24, 2024
@engcom-Delta engcom-Delta reopened this May 24, 2024
@m2-community-project m2-community-project bot removed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: dev in progress Reproduced on 2.3.5p1 Only if reproduced on 2.3.5p1 but not on 2.4-develop Progress: done labels May 24, 2024
Copy link

m2-assistant bot commented May 27, 2024

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November
Copy link
Contributor

Hello @nahall,

Thank you for the input.

Verified this on 2.4-develop.
I have modified the template file to call getImageUrl(), as you can see in the below image:
image

It can be seen that the image is being rendered with relative path.
image

The getImageUrl() method returns relative path of the image.

Hence this issue can be confirmed.

Thank you.

@engcom-November engcom-November added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Catalog labels May 27, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-12016 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented May 27, 2024

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Catalog Component: Catalog Component: Image Component: Url Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.3.5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Ready for Development
Development

No branches or pull requests