Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
edit.module
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
21 Nov 2013 at 13:48 UTC
Updated:
5 Aug 2020 at 04:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wim leersThis patch solves the problem through the following changes:
entityInstanceID: an incrementing number starting at 0.Drupal.edit.EntityModelnow has aentityIDand aentityInstanceIDattribute in addition to the pre-existingidattribute. TheentityIDattribute now contains what theidattribute contained before (something likenode/1). TheentityInstanceIDspeaks for itself. Theidattribute now provides a "globally unique" identifier for the entity:<entityID>:[<entityInstanceID>], e.g.node/1[0].Drupal.edit.FieldModelnow has afieldIDattribute that contains what theidattribute contained before (something likenode/1/body/en/full). Theidattribute now provides a "globally unique" identifier for the field:<fieldID>:[<entityInstanceID>], e.g.node/1/body/en/full[0].Comment #2
wim leersCan be reviewed, but should NOT be committed until #2139921: Contextual links can't handle multiple occurrences of the same contextual links is committed.
Comment #3
wim leers#2139921: Contextual links can't handle multiple occurrences of the same contextual links was committed, reviews welcome!
Comment #4
jessebeach commentedI really like the changes of
idtofieldIDandentityID; it makes the code easier to read. We can always remap the ID attribute of the models later if ever we go full REST: http://backbonejs.org/#Model-idAttributeFor consistency, this should be
this.fieldModel.get('fieldID').replace()That's my only needs-change feedback. Otherwise it looks great and functions.
Comment #5
wim leersActually, that was intentional. It ensures that the DOM ID attributes that are generated are unique across the entire page: they're entity instance-specific.
i.e.:
fieldIDwould be"node/1/title/en/teaser"idwould be"node/1/title/en/teaser[0]"(note the entity instance identifier at the end[and]with a dash.Comment #6
jessebeach commentedOk, that was my only concern. Thanks for the explanation.
I've gone through further manual testing and there are no behavioral regressions.
It solves the issue of being able to launch quick edit on instances of the same entity on the same page.
Comment #7
chx commentedThis is the kind of attention to detail that makes the Spark team outstanding. Very nice.
Comment #8
dries commentedCommitted to 8.x. Thanks.
Comment #9
wim leersComment #10
wim leersNow also backported to the Drupal 7 contrib module: http://drupalcode.org/project/edit.git/commit/a8b36d9.
Comment #12
sittard commentedThis bug or similar appears to be present in Drupal 8.1.8.
Steps to reproduce:
Attached are some screen shots to help highlight the issue.
Comment #13
sittard commentedComment #14
sittard commentedJust ran a test on 8.3.x-dev and the quick edit worked as expected on the first page load. But failed on subsequent page loads, cleared browser cache and flushed full cache but contextual links still don't appear.
Also noticed in this post (https://www.drupal.org/node/2650910) discussion around non-cache and cached-cases. Perhaps it's related.
Comment #18
jamaral86 commentedIm going to triage it
Comment #19
droplet commentedThat's great if anyone can write a test to prove it still a problem.
Comment #26
pameeela commentedConfirmed this is working on 9.0.2 so I'm going to set this back to Fixed.
Screenshots of contextual links working using the steps to reproduce from the IS:
Comment #27
pameeela commentedOops, fixed first screenshot, wrong image.