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
| Comment | File | Size | Author |
|---|---|---|---|
| image.png | 114.42 KB | hawkeye.twolf |
Issue fork field_protect-3253216
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
Comment #3
hawkeye.twolfI 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:
processedFieldscheck, which got in the way of the "Unlock field" button on ajax-reloaded content such as Entity Browser IEFdocument.querySelector()withcontext.querySelector()to prevent duplicate processing of fieldsComment #6
e0ipso