Over in #1283892: Let Render API fail in a tale-telling way on invalid $element, an error message is added to help debug invalid render arrays, i.e., a key that does not begin with # and whose value is not an array. This exposed a bug in the toolbar, its method of adding a class.

Instead of manually building up the classes array, then imploding it, then printing it, why not use '#type' => 'container' and #attributes?

CommentFileSizeAuthor
#1 drupal-1285098-1.patch1.03 KBtim.plunkett
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1.03 KB

Note, this does not attempt to fix #1215304: Toolbar incorrectly add whitespace to body when there's no expandable content to fill it at all, but does not affect it either.

sun’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D7

Looks good to me.

Also, +1 for backporting identically, even though it changes a theme template.

Dries’s picture

Version: 8.x-dev » 7.x-dev

Committed to 8.x.

I'm leaning towards not backporting this to 7.x as it requires templates to be updated. In other words, this change can break existing sites. Leaving for webchick to consider.

webchick’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs backport to D7

Agreed. People running into the issue of empty divs will have already worked around it in their themes. Happy to see this fixed in D8 though.

Status: Fixed » Closed (fixed)

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