Problem/Motivation
- Install D8 with the Standard install profile.
- Create two nodes, with arbitrary data in the title and body fields.
- Open your browser's developer tools.
- Go to the front page.
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| quickedit_inplaceeditor_loading_race_condition.patch | 1.13 KB | wim leers |
Comments
Comment #1
swentel commentedNicely spotted. Patch fixes the multiple requests, in place editing still keeps working with patch too.
Comment #2
webchickCommitted and pushed to 8.x. Thanks!
Comment #5
yesct commentedchanging 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.