WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 13 months ago

Last modified 13 months ago

#36483 closed defect (bug) (worksforme)

Inline image replacement in Post Editor does not replace image

Reported by: Ipstenu Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5
Component: Editor Keywords:
Focuses: Cc:

Description

Tested on 4.5-RC2-37173 with the following steps:

  1. Make a new post
  2. Add m08aGa1nAM.png to post as medium image
  3. Click to REPLACE image
  4. Click 'Edit Original'
  5. DELETE from this window
  6. Upload new m08aGa1nAM.png

At this point, I see the OLD image in the edit page. As soon as I hit 'save draft' however, it shows the correct image.

Tested on WP 4.4.2 and the image replaces as expected, no need to save.

It looks like whatever ajax magic is supposed to refresh that image isn't happening until save.

Attachments (1)

edit-image.png (440.9 KB) - added by azaozz 4 years ago.

Download all attachments as: .zip

Change History (12)

This ticket was mentioned in Slack in #core by mike. View the logs.


4 years ago

@azaozz
4 years ago

#3 @azaozz
4 years ago

Think I'm missing or misunderstanding a step when trying to reproduce.

  1. DELETE from this window.

I'm in the modal in the image file editor and cannot delete from there. Tried editing the image then deleting it and replacing it, all works as expected.

Another question: if the image is deleted in step 5, and another image with the same name is uploaded, and the old one is shown in the editor, where the old one comes from? At this point it is not on the server any more? It is possible some sort of "network cache" is interfering, as old and new images have the same name. Not sure why it only happens sometimes though.

Last edited 4 years ago by azaozz (previous) (diff)

#4 follow-up: @Ipstenu
4 years ago

I gave the unclear directions

  1. Click to REPLACE image
  2. Click 'Edit Original'


So on the post editor, click the pencil and then press the box to replace the image, not edit.

https://cloudup.com/cLAG65T_A3h

  1. Click to edit the image
  2. Press REPLACE button

Another question: if the image is deleted in step 5, and another image with the same name is uploaded, and the old one is shown in the editor, where the old one comes from?

The replacement window. Drag/drop the new image with the old image name.

Last edited 4 years ago by Ipstenu (previous) (diff)

#5 in reply to: ↑ 4 @azaozz
4 years ago

Replying to Ipstenu:

Thanks, yeah, can see it now.

A new bug is that the right sidebar (image info and settings) doesn't get refreshed/cleared out after deleting an image. Seems caused by the Backbone update as far as I see.

The image not refreshing after replacing it is tougher. Was able to reproduce in 4.4 too, but less frequently. Seems the browsers "hold onto" the image in the editor despite that it is no longer on the server. Can happen more reliably after deleting an image, no need to replace. Steps:

  1. Open the media modal, upload an image and insert it in a post.
  2. Edit the image, and delete it permanently.
  3. Close the modal by clicking outside or on the top/right close button.

At this point the image is displayed in the editor. After switching to the Text editor and back (i.e. forcing TinyMCE to reload the post content) the image is still displayed, although it is not on the server any more. Only after saving a draft/reloading the page the image will be displayed as missing.

#6 @ocean90
4 years ago

  • Keywords needs-testing added
  • Version changed from trunk to 4.5

A new bug is that the right sidebar (image info and settings) doesn't get refreshed/cleared out after deleting an image. Seems caused by the Backbone update as far as I see.

Moved into #37099.

This ticket was mentioned in Slack in #core by ipstenu. View the logs.


4 years ago

#8 @desrosj
13 months ago

  • Keywords close reporter-feedback added

I was looking into reproducing this issue today, but I can't seem to reproduce it. @Ipstenu do you happen to remember any details on this one?

I am marking this as a close candidate, but since a lot of the media modals are reused within the block editor, we should be sure the issue does not still exist and carries over.

#9 @Ipstenu
13 months ago

This doesn't seem to happen on 5.2.1! Excellent.

#10 @Ipstenu
13 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

#11 @desrosj
13 months ago

  • Keywords needs-testing close reporter-feedback removed
  • Milestone Awaiting Review deleted

Thanks for the follow up!

Note: See TracTickets for help on using tickets.