WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#53159 new defect (bug)

Media aren't attached if uploaded from libray and are attached if uploaded from post

Reported by: ellimstom Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.7.1
Component: Media Keywords: reporter-feedback close
Focuses: Cc:

Description

It seems that medias keep unattached if they are uploaded from library before adding them to post or custom_post. If they are uploaded from post or custom_post, it's working fine.

Here are the reprocedures:

  1. Working one: Upload from post:
    • 1. create a post
    • 2. click to add featured image
    • 3. upload an image and attach
    • 4. Publish post
    • 5. Go to library and filter unattached
    • Result: the uploaded image don't show up
  2. Issued one: Upload first:
    • 1. go to library and upload an image
    • 2. create a post
    • 3. click to add featured image
    • 4. Publish post
    • 5. Go to library and filter unattached
    • Result: the uploaded image shows up

The same behaviour has been found while attaching images to Woocommerce products with CSV import. It's been tested with Automattic support and they have the same issue on their side.

Change History (2)

#1 @desrosj
6 weeks ago

  • Component changed from General to Media
  • Keywords reporter-feedback close added

Hi @ellimstom,

Welcome to Trac!

Can you clarify whether you are using the block editor or the Classic Editor? I am able to reproduce the behavior, but only using the block editor.

If you are indeed using the block editor, this will need to be reported as an issue upstream in the Gutenberg GitHub repository. I'm adding a suggestion to close this ticket as reported-upstream pending that confirmation.

I did some digging to see if this was intentional, and I couldn't find anything. I'm going to link several related items though:

It's worth noting that originally, the attached status just signified that an image was uploaded to a post, so post_thumbnails and attachments embedded in posts can inconsistently be attached/unattached in ways that make technical sense, but the attached/unattached relationship has grown over time and has become quite confusing and inconsistent.

This behavior was initially introduced into the Classic Editor in [22843].

#2 @ellimstom
6 weeks ago

Hi @desrosj,

I guess I'm in block editor, but I don't really use it because I installed a page builder. I discovered this by adding a feature image from backend (see screenshot).https://drive.google.com/file/d/1oL7sCsOv2zNd3o221pWMSEwxuDkcCCZv/view?usp=sharing

The same occurs while adding product image in Woocommerce where there is no block editor (only classic editor).

I understand that originally, the attached status just signified that an image was uploaded to a post, but it is far better to know whether or not an image is not attached and so unnecessary in filesystem (a lot less images to deal with when you have hundreds). Maybe there is a media library improvement scheduled...

Note: See TracTickets for help on using tickets.