Problem

With latest 11.x dev (11.3 dev) the module crashes when adding a node:

InvalidArgumentException: "attributes" is an invalid render array key. Value should be an array but got a object. in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).

Drupal\Core\Theme\ThemePreprocess->preprocessItemList() (Line: 622)
template_preprocess_item_list() (Line: 56)
responsive_preview_preprocess_item_list__responsive_preview() (Line: 374)
Drupal\Core\Extension\ModuleHandler->invoke() (Line: 306)
Drupal\Core\Theme\ThemeManager->Drupal\Core\Theme\{closure}() (Line: 335)
Drupal\Core\Theme\ThemeManager->render() (Line: 499)
Drupal\Core\Render\Renderer->doRender() (Line: 512)
Drupal\Core\Render\Renderer->doRender() (Line: 512)
Drupal\Core\Render\Renderer->doRender() (Line: 229)
Drupal\Core\Render\Renderer->render() (Line: 41)
template_preprocess_toolbar()

Steps to reproduce

- Enable module, enable toolbar module, install vanilla 11.x-dev standard profile
- Add an article

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fago created an issue. See original summary.

fago’s picture

Title: template_preprocess_item_list » InvalidArgumentException: "attributes" is an invalid render array key with 11.x-dev
Issue summary: View changes
fago’s picture

commenting out template_preprocess_item_list() in responsive_preview_preprocess_item_list__responsive_preview() removes the exceptoin but makes the responsive-preview list appear always empty for me

sourabhsisodia_’s picture

Assigned: Unassigned » sourabhsisodia_
sourabhsisodia_’s picture

@fago the issue did not reproduced , i tried the above mentioned steps

sourabhsisodia_’s picture

Assigned: sourabhsisodia_ » Unassigned
fago’s picture

running into this again now that 11.3 is out. See #3564252: Warning Preprocess callback is not valid: "attributes" is an invalid render array key leads to broken pages for more background.

I see it fixed when the item pre-processing is not used any more. Not sure whether it's needed in 11.3 still, everything seems to work fine without the pre-processing.

fago’s picture

Status: Active » Needs review
fago’s picture

StatusFileSize
new1.35 KB

here is a patch file for composer-patches usage.

drubb’s picture

Thanks, this patch solved multiple problems for me:

- Bubbling Assertion errors
- Missing preview icon in Admin Toolbar
- Missing Tools icon in frontend theme
- Missing links from Admin Toolbar Tasks

bohus ulrych’s picture

Thank you for the patch #10, without it my site was broken for reasons described in #3564252
Tested with Drupal 11.3.1

johnatas’s picture

StatusFileSize
new1.26 KB

Hello,

Like the previous comments, I encountered similar issues when upgrading to Drupal 11.3.x, and the fix resolves all my problems correctly — thank you.

However, neither patch #10 nor MR !31 applies cleanly to version 2.3.0 of the module.
I am attaching a patch that applies successfully and works as expected on my side.

volkerk made their first commit to this issue’s fork.

volkerk’s picture

chr.fritsch’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me

codebymikey’s picture

StatusFileSize
new7.7 KB

Attached a patch which applies against 2.3.0

volkerk’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Thank you :) for this fix.
Hopping for a tag release.
Not sure if it is recommended to use with Drupal CMS ~2.0

johnatas’s picture

Maintainers, don't forget to credit people who helped resolve this issue.
Thanks,

finn lewis’s picture

Confirmed the bug in Drupal 11.3 and the patch in #17 fixes it.

Any chance we could get a release?

Thanks so much to everyone for this :)

rajeshreeputra’s picture

Released 2.3.1!

finn lewis’s picture

Amazing, thanks so much @rajeshreeputra!

Status: Fixed » Closed (fixed)

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