Problem/Motivation

When clicking the "Unlock" button on a field that was reinitialized (e.g., via an ajax callback such as Entity Browser modal), the page location changes to a raw JSON response rather than just opening the Unlock modal. See attached screenshot.

Steps to reproduce

E.g., with Entity Browser: Open the entity edit modal (the add form loads in an iFrame and thus is not affected).

Proposed resolution

Track processed elements rather than just processed field names.

Remaining tasks

Code review

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
image.png114.42 KBhawkeye.twolf
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hawkeye.twolf created an issue. See original summary.

hawkeye.twolf’s picture

I confirmed that this implementation works with "Add another" (unlimited cardinality) fields.

And please note this from the MR comments, that there are two main changes:

  1. Removing the processedFields check, which got in the way of the "Unlock field" button on ajax-reloaded content such as Entity Browser IEF
  2. Replacing document.querySelector() with context.querySelector() to prevent duplicate processing of fields

e0ipso made their first commit to this issue’s fork.

  • e0ipso committed 8b77050 on 1.x authored by hawkeye.twolf
    Issue #3253216 by hawkeye.twolf: Process ajax-replaced elements for...
e0ipso’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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