Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
This error was reported by pookmish here: #3082690-127: Mark Media Library as a stable core module
Pookmish writes:
I believe this is the issue an error has come from:
User error: "0" is an invalid render array key in Drupal\Core\Render\Element::children()
I found that in the function
seven_form_media_library_add_form_upload_alter()
there is an incorrect attributes key.
$form['attributes']['class'][] = 'media-library-add-form--upload';
should be
$form['#attributes']['class'][] = 'media-library-add-form--upload';
My database logs are full of this error now.
Proposed resolution
Add hash?
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#3 | 3094397-3.patch | 708 bytes | oknate |
Comments
Comment #2
oknateI can confirm the bug. I get two log messages each time the media library is opened.
Additionally, the 'media-library-add-form--upload" class is missing.
Comment #3
oknateI can confirm on my local, the fix works. No more log messages and the class actually appears.
Comment #4
seanBRTBC assuming this will be green. Patch works for me as well. Seems like we do need to prioritize #3090983: [PP-2] Test Seven's changes to Media Library to catch stuff like this.
Comment #5
alexpottCommitted and pushed e86eeda5f1 to 9.0.x and 9ec0e09ccc to 8.9.x and 241238e422 to 8.8.x. Thanks!
I backported this to 8.8.x because media library becomes stable in that release and this is important. And yes we need that test coverage.
Comment #9
oknateCan we give credit to pookmish who reported the issue and suggested the fix?
Comment #10
pookmish CreditAttribution: pookmish commentedThanks @oknate.
Comment #11
alexpottSure. Sorry I missed that in the issue summary.