WordPress.org

Make WordPress Core

Opened 10 years ago

Last modified 5 months ago

#12769 new defect (bug)

Disappearing posts/pages (in quickedit mode)

Reported by: catahac Owned by:
Milestone: Priority: low
Severity: minor Version: 2.9.2
Component: Quick/Bulk Edit Keywords: has-patch
Focuses: ui, javascript Cc:
PR Number:

Description

Steps to reproduce:

  1. Quickedit a post.
  2. Click save and instanly click quick-edit on another post.

When the ajax-request completes the first quick-edited post will disappear from the posts table. This is only a display bug.

Attachments (2)

12769.diff (14.5 KB) - added by kevdotbadger 5 years ago.
12769.without-min-version.diff (643 bytes) - added by kevdotbadger 5 years ago.
Same diff, but without the min version.

Download all attachments as: .zip

Change History (14)

#1 @hakre
9 years ago

Just experienced the same. Can confirm this for 3.0 trunk. It's a bug in the frontend JS logic. Defect by Design.

#2 @nacin
9 years ago

  • Keywords needs-patch added; quick edit quick-edit disappear removed
  • Milestone changed from Awaiting Review to Future Release

#3 @lsparks
9 years ago

  • Version changed from 2.9.2 to 3.1

This is still an issue as of 3.1, any updates as to when this might get addressed?

#4 follow-up: @sivel
9 years ago

  • Version changed from 3.1 to 2.9.2

Please do not change the version on tickets. The version is used to track when a bug was introduced/identified.

#5 in reply to: ↑ 4 @lsparks
9 years ago

Sorry, I didn't know that. Thanks for the info.

Please do not change the version on tickets. The version is used to track when a bug was introduced/identified.

#6 @chriscct7
5 years ago

This still occurs also its really hard to trigger.
To reproduce:

  • Edit something on the quick view of a post (but do not click save)
  • Move cursor over the quick edit of another post.
  • Hit enter (which triggers the JS to submit the quick edit) and instantly after you do that click on the quick edit button on the second post your cursor was already on.

Incredibly hard to do unless you're really trying to do this, but still reproducible nonetheless

@kevdotbadger
5 years ago

#7 @kevdotbadger
5 years ago

I think the problem is caused the removal and appending of the new row returned by the AJAX request, although I'm not 100% sure (it might have something to do with either the ID getting messed up, or which rows are being removed, or the revert() happening at the beginning of the edit, or something else!?)

Anyway, the old code was

$(inlineEditPost.what+id).remove(); // Remove the original (now hidden) post row
$('#edit-'+id).before(r).remove(); // before the editor row, add the new HTML returned by the save AJAX request, then remove the edit row
$(inlineEditPost.what+id).hide().fadeIn(); // with the new returned and added to the DOM, hide it then fade in.

My solution was to use the original row, and not remove it at all. Simply inject the needed HTML back into it. This solves bug.

$('#edit-'+id).remove(); // Remove the edit row
$(inlineEditPost.what+id).empty().append($(r).html()).fadeIn(); // Inject the needed HTML the original post row and fade in

The r returned by the AJAX call contains the whole row as HTML, I'm not sure if this returned HTML is used elsewhere, so i left that alone. The $(r).html() simply gets the child elements which we need to inject back into the original row.

@kevdotbadger
5 years ago

Same diff, but without the min version.

#8 @kevdotbadger
5 years ago

  • Keywords has-patch dev-feedback added; needs-patch removed

I'm also unsure how the core team handles minified versions, do they minify everyone prior to release? Anyone 12769.without-min-version.diff is the same diff but without me touching the .min version.

#9 @afercia
4 years ago

  • Keywords reporter-feedback added; dev-feedback removed

Some things have changed in the Quick Edit form in the last months: buttons are now buttons, JavaScript events, etc. Couldn't reproduce anymore, but maybe I'm missing something. @chriscct7 would you mind to double check and try to reproduce when you get a chance? :)

#10 @afercia
4 years ago

Nevermind, was finally able to reproduce. Very unlikely to happen though, unless you're doing it intentionally :) What I'd do:

  • on Quick Edit link click
  • return if a previous AJAX request has not completed

Investigating also #25696 which maybe requires a similar solution.

#11 @afercia
4 years ago

  • Focuses ui javascript added
  • Keywords reporter-feedback removed
  • Milestone changed from Future Release to 4.5

See #25696 for a proposed solution. Note: this happens also on Categories, Tags, and Comments.

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

#12 @jorbin
4 years ago

  • Milestone changed from 4.5 to Future Release

No changes in the last 8 weeks, so I'm bumping from 4.5.

@afercia If you think you have a fix, feel free to re-milestone.

Note: See TracTickets for help on using tickets.