Problem/Motivation

  1. Install D8 with the Standard install profile.
  2. Create two nodes, with arbitrary data in the title and body fields.
  3. Open your browser's developer tools.
  4. Go to the front page.
  5. Now look at the XHR requests in your browser's developer tools.

You'll see two requests to /quickedit/attachments, both with

editors[]=plain_text
editors[]=form

in the POST data.

This means that we're trying to load the same in-place editors *twice* (and in fact N times, where N is the number of nodes on the page).

(Originally discovered via #2191281: AJAX error when nonexistent editor passed to edit/attachments (and: multiple in-place editor attachment requests) — the D7 backport of Quick Edit.)

Proposed resolution

The above problem happens due to a race condition: as we discover in-place editable fields, we discover which in-place editors will be needed, and we then load those that are missing. But the code doesn't take into account that loading those in-place editors takes some!

In other words: we have a race condition, that means that in 99% of the cases, in-place editors are loaded multiple times rather than once.

Remaining tasks

Review & commit.

User interface changes

None.

API changes

None.

Comments

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Nicely spotted. Patch fixes the multiple requests, in place editing still keeps working with patch too.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

  • webchick committed f641db5 on 8.0.x
    Issue #2324211 by Wim Leers: Fixed Multiple requests to /quickedit/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

yesct’s picture

Issue tags: -front-end performance +frontend performance

changing to use the more common tag, so the less common one can be deleted, so it does not show up in the auto complete and confuse people.