Make processing the form (inputs) on build() a setting

Created on 22 July 2024, about 2 months ago

Problem/Motivation

In 🐛 LogicException: Cannot create key "article" on non-array value. in Drupal\Component\Utility\NestedArray::setValue() (Zeile 154 in web/core/lib/Drupal/Component/Utility/NestedArray.php). Postponed we found out that it's not generally required to call

->setAlwaysProcess()

in the build() method of the block.

In cases where the views form displayed in the block should not handle parameters on the page, where it is placed, but just to be passively used as form submitter, you don't need to process the form in the block.

When submitting the exposed filter block form, the target view will handle the submitted values!

Steps to reproduce

Proposed resolution

  1. Add a boolean block option "Always process the form (on build)"
  2. Set it true by default (for BC and for cases where it's expected)
  3. Only execute ->setAlwaysProcess() in build() if the option is TRUE

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024