Updated: Comment #0
Problem/Motivation
Discovered via #2075185: When an entity is in-place edited (i.e. saved), other instances of that entity on the same page are not updated (no propagation).
When the same content appears more than once on the same page, that content naturally has the same contextual links (specifically, exactly the same contextual links placeholder, e.g. <div data-contextual-id="node:node=2:"></div>). Each contextual link should work correctly and act independently, of course.
However, that is not what happens. In the current codebase, when opening one contextual link (by clicking on the pencil icon), the other one will be opened as well, because they share the same state.
Steps to reproduce:
- Create an article node.
- Expose the frontpage as a block in the sidebar.
- Go to the frontpage. The same node now appears twice: once in the main content area, once in the sidebar. Click either contextual link. Both contextual link menus will be opened.
Proposed resolution
Fix this.
Remaining tasks
None.
User interface changes
None.
API changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | interdiff.txt | 637 bytes | wim leers |
| #2 | contextual_multiple_identical-2139921-2.patch | 1.38 KB | wim leers |
| #1 | after.png | 55.76 KB | wim leers |
| #1 | before.png | 56.86 KB | wim leers |
| #1 | contextual_multiple_identical-2139921-1.patch | 1.39 KB | wim leers |
Comments
Comment #1
wim leersComment #2
wim leersnod_ told me I should use
.eq()rather than.slice(). Much cleaner :)Comment #3
nod_Works for me. All good.
Comment #4
webchickNice find!
Committed and pushed to 8.x. Thanks!
Comment #5
wim leersComment #7
fgmAdded reference to new occurrence of a similar issue in 8.4.