magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Lack of information about the size of the file for already uploaded images #36681

Open alemanski opened 1 year ago

alemanski commented 1 year ago

Preconditions and environment

Steps to reproduce

On the vanilla version of Magento filled with sample data, proceed with the following steps:

  1. Go to the admin panel
  2. Log-in
  3. Go and edit selected content type element (e.g., Content -> Elements -> Pages -> About Us)
  4. Place the Row element into the Page Builder area
  5. Place the Image element into the previously inserted Row
  6. Edit the image by clicking gear icon
  7. In the edit form, select the image to upload
  8. You should see the image preview along with its dimensions and size
  9. Save data by clicking "Save" in the image edit form
  10. Save the whole content by clicking the "Save" button in the Page edit bar
  11. After when the page reloads, click the gear icon on the previously added image
  12. When editing, the image form will load, and you will see the image preview and its dimensions, but the size will show 0 Byte
image

Expected result

As a result, you should see a preview of the image, its dimension, and the image file size expressed in the proper unit of measure.

image

Actual result

Currently, you will see a preview of the image and its dimensions, but the file size will show "0 Byte", which is a hardcoded value.

image

Additional information

After my investigation, I've found out that information about the file size is created with a default value of 0, which is overridden only in case a new file is uploaded. Other activities like previewing already uploaded (and attached file) will show 0 Byte below the thumbnail.

All PageBuilder components which contain a file-uploader UI component in edit form are affected by this bug.

Release note

I prepared a patch for this issue. I'll share it when I figure out how to do this officially.

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @alemanski. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. 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: :point_down:

engcom-Bravo commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

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

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Bravo, here is your Magento Instance: https://36521e5192b1ad63d42bf857fcfb2a38.instances.magento-community.engineering Admin access: https://36521e5192b1ad63d42bf857fcfb2a38.instances.magento-community.engineering/admin_13af Login: 84ab38ee Password: 53a269eec9f7

alemanski commented 1 year ago

Hi @engcom-Bravo How can I propose a solution to this problem? Because I created a patch which solves this issue.

Best regards, Artur

engcom-Bravo commented 1 year ago

Hi @alemanski,

Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Steps to reproduce

1.Go to the admin panel 2.Log-in 3.Go and edit selected content type element (e.g., Content -> Elements -> Pages -> About Us) 4.Place the Row element into the Page Builder area 5.Place the Image element into the previously inserted Row 6.Edit the image by clicking gear icon 7.In the edit form, select the image to upload 8.You should see the image preview along with its dimensions and size 9.Save data by clicking "Save" in the image edit form 10.Save the whole content by clicking the "Save" button in the Page edit bar 11.After when the page reloads, click the gear icon on the previously added image 12.When editing, the image form will load, and you will see the image preview and its dimensions, but the size will show 0 Byte

Before save the image

Screenshot 2022-12-30 at 1 20 55 PM

After saving the page Size of image was missing.

Screenshot 2022-12-30 at 1 21 20 PM

Hence confirming this issue.

Thanks.

github-jira-sync-bot commented 1 year ago

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

m2-assistant[bot] commented 1 year ago

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

alemanski commented 1 year ago

Hi all, I created PR with the proposition of solving this issue. It is available here: https://github.com/magento/magento2/pull/36685

Best regards, Artur