Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55819 closed defect (bug) (duplicate)

Original image name, when too long breaks the attachment edit screen

Reported by: anantajitjg's profile anantajitjg Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.4
Component: Media Keywords: has-screenshots has-patch
Focuses: css Cc:

Description

Original image section in the attachment edit screen breaks the layout when the file name is too long.

Steps to replicate this issue

  • Rename any image above the threshold limit (2500 pixels) to a long name, for example to 121310f3a0d098002a8bd1b50bf34b81f5f85b1a1653464450.jpg.
  • Then upload the image via Media Library.
  • Now choose the list view instead of the Grid view and go to the media attachment edit screen or click 'Edit more details' from the Grid view.
  • In the edit screen, the original file name takes the whole line and breaks the layout.

Expected Behaviour

The 'Original image' should wrap as same as the 'File name'.

Attachments (4)

Screenshot 2022-05-25 at 2.24.58 PM.png (3.7 MB) - added by anantajitjg 2 years ago.
55819.diff (357 bytes) - added by anantajitjg 2 years ago.
This patch should fix the issue
Screenshot 2022-05-25 at 3.02.51 PM.png (4.0 MB) - added by anantajitjg 2 years ago.
Attachment Edit screen after applying the fix
Screenshot 2022-05-25 at 5.02.22 PM.png (3.4 MB) - added by nidhidhandhukiya 2 years ago.
I have attached screenshot for better understanding.

Change History (12)

@anantajitjg
2 years ago

This patch should fix the issue

@anantajitjg
2 years ago

Attachment Edit screen after applying the fix

#1 @anantajitjg
2 years ago

  • Keywords has-patch added

#2 @nidhidhandhukiya
2 years ago

Hello @anantajitjg
I am not able to reproduce this issue.

Test Environment :-
wordpress Version :6.0

@nidhidhandhukiya
2 years ago

I have attached screenshot for better understanding.

#3 @anantajitjg
2 years ago

Hi @nidhidhandhukiya

Please note that you have to use a long name and don't use hyphens for joining the names. You can try it with underscores or use the name I have mentioned in Steps to replicate this issue section.

#4 @afercia
2 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.0.1
  • Version trunk deleted

To clarify a bit: the 'Original image' section appears only when the uploaded image width or height exceed the 2560 pixels threshold used in wp_create_image_subsizes().

When this happens, the image is automatically resized and its file name gets a _scaled suffix, while the original file name is shown below in the 'Original image' section.

The patch looks good to me. Moving to next minor release consideration, as it's a simple and self-contained improvement.

#5 @anantajitjg
2 years ago

Thanks @afercia

#6 follow-up: @sabernhardt
2 years ago

We were already tracking this issue in #55393, with the same patch. Instead of marking one ticket as a duplicate of the other, would closing both with the same commit be preferable?

#7 @sabernhardt
2 years ago

  • Focuses css added
  • Keywords commit removed

File names may need to wrap within the details dialogs, too, so I uploaded two options on #55393 to consider more thorough approaches.

#8 in reply to: ↑ 6 @peterwilsoncc
2 years ago

  • Milestone 6.0.1 deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version set to 5.4

Replying to sabernhardt:

We were already tracking this issue in #55393, with the same patch. Instead of marking one ticket as a duplicate of the other, would closing both with the same commit be preferable?

It's preferable to mark as a duplicate and close a single ticket as it's easy to miss duplicate tickets during the commit process.

As #55393 includes notes from the test team confirming the fix, I've marked this as a duplicate.

Note: See TracTickets for help on using tickets.