- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 8:44am 12 March 2024
2 types of content, A and B.
A refers to B via a entity reference field, with the Entity Browser widget. It's configured to show the edit and remove buttons.
Both A and B have another entity references field, to files.
When I'm in the edit form of A and press the Edit button on B, a modal is opened with the edit form of B. However, not the files of B show up in the modal, but the files of A.
The cause of this is EntityReferenceBrowserWidget::getEntitiesByTargetId() using the unfiltered $form_state->getUserInput(), which contains the values of A's edit form, which are submitted when opening the modal via AJAX. The code in question was added in #2764889: Entity Browser widget loses selected images in inline entity form → . A code comment already mentions that this needs to be refactored, "// TODO Figure out how to avoid using raw user input." and there seems to be a ticket for that as well, #2825890: Refactor and clean EntityReferenceBrowserWidget::formElementEntities() → , but I was not able to find a bug report yet about the wrong field values being used in the modal.
Needs review
2.0
Widget plugins
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.