Warning: Trying to access array offset on value of type null on DrowlLayoutsMultiWidthLayoutBase->submitConfigurationForm() Zeile 89

Created on 23 June 2021, about 3 years ago
Updated 7 March 2024, 6 months ago

Problem/Motivation

The root cause of this problem seems to be a core bug in Media Browser: #3220298: Media entity browser breaks form state (values removed) on entity creation

"Warning: Trying to access array offset on value of type null in Drupal\drowl_layouts\Plugin\Layout\DrowlLayoutsMultiWidthLayoutBase->submitConfigurationForm() (Zeile 89 in drowl_layouts/src/Plugin/Layout/DrowlLayoutsMultiWidthLayoutBase.php).: "

Reason seems to be that in

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state)
  {
    $this->configuration['column_widths'] = $form_state->getValue('column_widths_wrapper')['column_widths'];
    $this->drowlLayoutsSettingsTraitSubmitConfigurationForm($form, $form_state);
  }

$form_state is of type https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21Su... and our values are in "subform" key, not on the first level.
Anyway the value is saved after editing.

Steps to reproduce

Create a new node with a 2 column layout with a background image and no explizit column_width set.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: outdated

Version

4.1

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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.

Production build 0.71.5 2024