Closed (fixed)
Project:
Entity Browser
Version:
8.x-2.x-dev
Component:
Core API
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2020 at 06:00 UTC
Updated:
6 Jul 2022 at 20:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
larowlanComment #3
sim_1I have spent so much time trying to figure out how to solve this issue. Thank you!!!! Marking RTBC because it allows the media library to be used in an editor. I'm sure there are other use cases too.
Comment #4
JvE commentedComment #5
JvE commentedI don't think all entity forms on that route should be altered either. Just the initial one.
If anything else builds an entity form during the same request we don't want that to be altered do we?
Comment #6
ammaletu commentedI have the same problem: I am editing a custom content in a modal, which contains a media library element. There is an "add media" button, rendered by the media library widget. Clicking on it should open a second modal with the media library, but instead leads to:
TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given, called in /var/www/html/web/modules/contrib/entity_browser/entity_browser.module on line 75 in Drupal\Core\Render\Element::children() (line 72 of /var/www/html/web/core/lib/Drupal/Core/Render/Element.php)The patch from #2 might not be the perfect solution, but it solves this problem for all cases with completely different forms (tested on Drupal 9.3.14). Why not merge this and create a new ticket that describes the now smaller problem of multiple entity browser forms? What is needed to get this ready?
Comment #7
danflanagan8I'm here with the exact same problem described in #6. The patch in #2 fixes my problem. Thanks for the patch, @larowlan.
I am very much of the opinion that this should get committed.
It's definitely an improvement even if it's not perfect. It's possible that comment #5 is correct, but there aren't any clear comments or steps to reproduce on this or the duplicate issue that demonstrate any failings of the patch here. Further, committing this patch would not introduce any new problems: the comment in #5 claims (probably correctly) this patch is not restrictive enough, not that it is too restrictive. I'm taking this back to RTBC.
I'm going to up the severity to Major since it's a fatal error that is easily triggered through the UI under normal configuration.
Comment #9
berdirCommitted.