WordPress / classic-editor

A plugin to restore the Classic Editor in WordPress.
https://wordpress.org/plugins/classic-editor/
Other
160 stars 86 forks source link

Editing Slug to an Existing Slug causes wrong content to display #201

Closed Ipstenu closed 5 months ago

Ipstenu commented 1 year ago

I am aware this is a weird one.

The setup is as follows:

  1. Make a clean website
  2. Make a couple posts (content does not matter)
  3. Install and Activate Classic Editor
  4. Make a new post and save as draft
  5. Copy the permalink from an existing post and paste it into the new post as the permalink, save as DRAFT (do not publish)
  6. You will see the NEW post has a -2 added to the permalink
  7. Open the existing post with the non -2

The post will display the content (title and all!) from the NEW post that is still in draft

This does not happen with the Block Editor.

I dug up that this is fixed in Gutenberg per https://core.trac.wordpress.org/ticket/52422 however it still exists in classic editor.

I reproduced this on WP 4.9.22 as well.

joedolson commented 1 year ago

If you reproduced this in 4.9.22, I assume that was without the classic editor plug-in? If so, this seems like it's probably a core bug, rather than a classic editor plugin bug.

Ipstenu commented 1 year ago

@joedolson That's why I linked to the trac ticket where it appears that this was corrected in the block editor.

I tested on 5.9 and it does happen, which makes it look like it was fixed in core around 6.1, and not accounted for whatever Classic is doing.

Would the fix belong in core (which is getting rid of classic) or the plugin that activates it?

I honestly don't know, but since in 6.2.2 the only way to reproduce it is via the Classic Editor, the it sort of argues that this should be fixed IN Classic Editor... if possible. Which I still don't know.

ETA: I worked backwards. In core, even with the Block Editor, this occurs up until 6.1.3. As soon as you're on that version, it stops happening. So again, this appears fixed in core and only breaks when you activate Classic.

joedolson commented 1 year ago

I think that the fix belongs in core, still; none of the relevant code is in the plugin, so any fix still needs to be committed to core.

The classic editor is still automatically enabled in some cases in core, such as custom post types without REST API support.

Ipstenu commented 1 year ago

Alrighty then, to core it goes.

https://core.trac.wordpress.org/ticket/58813

azaozz commented 5 months ago

Alrighty then, to core it goes.

Thanks!!