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

CommentFileSizeAuthor
#3 3094397-3.patch708 bytesoknate
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oknate created an issue. See original summary.

oknate’s picture

Issue summary: View changes

I 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.

oknate’s picture

Status: Active » Needs review
FileSize
708 bytes

I can confirm on my local, the fix works. No more log messages and the class actually appears.

seanB’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Media Initiative

RTBC 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.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 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.

  • alexpott committed e86eeda on 9.0.x
    Issue #3094397 by oknate: Attributes key missing hash or pound sign in...

  • alexpott committed 9ec0e09 on 8.9.x
    Issue #3094397 by oknate: Attributes key missing hash or pound sign in...

  • alexpott committed 241238e on 8.8.x
    Issue #3094397 by oknate: Attributes key missing hash or pound sign in...
oknate’s picture

Can we give credit to pookmish who reported the issue and suggested the fix?

pookmish’s picture

Thanks @oknate.

alexpott’s picture

Sure. Sorry I missed that in the issue summary.

Status: Fixed » Closed (fixed)

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