Make WordPress Core

Opened 2 months ago

Last modified 5 weeks ago

#53917 new defect (bug)

Default value of WEBP images in the Classic Editor

Reported by: almendron Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: has-patch
Focuses: Cc:


To replicate the problem:

1.- Upload a WEBP image to a post with the Classic Editor. In "Link to" put "None".

2.- Save entry.

3.- Now upload another WEBP image. It is supposed that in "Link to" it should put "None", but it is not like that since "Media file" is kept. For some reason it does not save the value of the previous upload.

Also, the view scrolls down

Note: if you do the same test with a "jpg" image, then it does save the value of the last image uploaded.

Attachments (1)

media.53917.diff (1.3 KB) - added by kallookoo 6 weeks ago.
Add webp extension to test

Download all attachments as: .zip

Change History (15)

#1 @desrosj
2 months ago

  • Component changed from Editor to Media

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

2 months ago

#3 @antpb
2 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.8.1

#4 @desrosj
8 weeks ago

  • Keywords reporter-feedback added
  • Milestone changed from 5.8.1 to Awaiting Review

Hi @almendron,

Thank you for this report, and welcome to Trac!

I've been trying to reproduce this, but it seems to be working as expected for me. I've tried several combinations of saving, inserting/uploading various image formats, and using different link options.

Can you check if you're able to reproduce with a fresh install? Or on the same install with no plugins active? Also, can you check your console for any JavaScript problems?

I'm going to kick this back to Awaiting Review since the 5.8.1 RC is due out in 2 days. If someone is able to reproduce and a patch is created/tested before then, it can be moved back for consideration.

#5 @almendron
8 weeks ago

1) Tests performed on a plugin-free installation (except with https://wordpress.org/plugins/classic-editor/ )

2) JavaScript problems? No

3) Have you tried the Classic Editor?

#6 @desrosj
8 weeks ago

  • Keywords needs-testing added; needs-patch removed

My testing process:

  • Fresh install of trunk (WP 5.9 nightly).
  • Classic Editor plugin active only.
  • Twenty Twenty-One theme active.
  • Click add media.
  • Upload WebP image.
  • Select a different Link To value.

I've tried the following both before and after saving:

  • Upload another WebP to the same post and a new post.
  • Upload another image format (JPG) to the same and a new post.

In all instances I'm unable to reproduce. The selected Link To value persists, and I see the value reflected in the user meta settings.

Can you check what the role of the user you are testing with is?

Also to be clear, I'm not trying to say you're not seeing the issue or that it's invalid, just that I am unable to reproduce it with the information available currently. It's possible another contributor can find out what I'm missing. But that has to be determined before a fix can be created.

#7 @almendron
8 weeks ago

Fresh install of trunk (WP 5.9 nightly) : Are you testing with version 5.9?

I work with version 5.8

#8 @desrosj
8 weeks ago

trunk is the latest development of WordPress, which is essentially 5.8 with some newer updates that will be included in the next release (5.9).

Just to be sure, I've retested using 5.8 and I am still unable to reproduce.

When you see the behavior, are you editing posts? Pages? A custom post type? Does it happen for all of them?

#9 @almendron
8 weeks ago

Post draft

1) Upload webp image. Change "Link to" -> "none"
2) Insert image and save draft
3) Upload webp image. "Link to" automatically changes to "Media file"

This does not happen with "alignment" and "size". They keep the values of the last uploaded image.

1) Upload jpg image. Change "Link to" -> "none"
2) Insert image and save draft
3) Upload jpg image. "Link to" it does not change. Is "none"

#10 @almendron
6 weeks ago

When you see the behavior,

are you editing posts? Pages? posts and pages

A custom post type? NO

Does it happen for all of them? Yes

#11 @kallookoo
6 weeks ago

After checking it, the problem is in the isImageAttachment function that checks if it is an image and the webp extension is not defined.

6 weeks ago

Add webp extension to test

#12 @almendron
6 weeks ago

  • Keywords has-patch added; reporter-feedback needs-testing removed

#13 @almendron
6 weeks ago

Hi @desrosj @antpb

I have spoken with several colleagues from "WordPress Spain" and they can all reproduce the problem.

@kallookoo , for example, has observed the problem and found the reason that one of the fields (Link to) is invariable. In less than 5 minutes, he has found the solution.

Can you change the value of "Milestone" so that the solution will be added in the next revision?

#14 @SergeyBiryukov
5 weeks ago

  • Milestone changed from Awaiting Review to 5.9

Related: #54146

Note: See TracTickets for help on using tickets.