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:

  1. Create an article node.
  2. Expose the frontpage as a block in the sidebar.
  3. 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.

Comments

wim leers’s picture

Status: Active » Needs review
Issue tags: +JavaScript
StatusFileSize
new1.39 KB
new56.86 KB
new55.76 KB
Before
After
wim leers’s picture

StatusFileSize
new1.38 KB
new637 bytes

nod_ told me I should use .eq() rather than .slice(). Much cleaner :)

nod_’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. All good.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Nice find!

Committed and pushed to 8.x. Thanks!

wim leers’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

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

fgm’s picture

Added reference to new occurrence of a similar issue in 8.4.