User error: {key} is an invalid render array key in Drupal\Core\Render\Element::children()

Created on 11 February 2021, almost 4 years ago
Updated 15 November 2023, about 1 year ago

Problem/Motivation

Error when using search facets with solr search api.

Proposed resolution

Prepend '#' before the 'url', 'value' and 'count' keys in ArrayWidget.php to avoid the render errors.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States jrb Raleigh-Durham Area, NC, USA

    Patch in #4 re-rolled for 2.0.6.

  • 🇳🇿New Zealand garethhallnz

    I have tested the patch in #6, and while it does resolve the render array key errors, it also causes the ArrayWidget to be empty, i.e., no items show in the facet block. The issue seems specifically related to the array keys 'values' and 'value' in methods prepare() and generateValues(), respectively.

    Here is an updated patch.

  • 🇮🇳India RohitRawat676

    i fix some coding standard

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • 🇺🇸United States jrb Raleigh-Durham Area, NC, USA

    @RohitRawat676

    While it is nice to make the code follow coding standards, it's not good practice to change code unrelated to the issue at hand in an issue patch. In this case, the previous patch changed 3 lines, but your patch changes over 150 lines. This makes it much more difficult to test that the patch fixes the issue without introducing any other problems.

    If you would like to suggest changes to make the code of this module (or any module) follow Drupal coding standards, that would be welcome, but it would be best to create a separate, new issue and add your patch there.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
Production build 0.71.5 2024