Warning: foreach() argument must be of type array|object, null given

Created on 3 November 2023, about 1 year ago
Updated 4 November 2023, about 1 year ago

Problem/Motivation

Hi there,

Drupal 9.5.11
Footable dev-2.x (but others too)

Views settings don't load after I choose the "Footable" format; in the log:

http://****/admin/structure/views/ajax/display/progetti/page_1/style_options?_wrapper_format=drupal_ajax

Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (linea 113 di ***/core/lib/Drupal/Core/Render/Element/Checkboxes.php).

Steps to reproduce

Proposed resolution

Basically i changed

220: '#default_value' => $this->options['footable']['breakpoint'][$name] ?? NULL,
to
'#default_value' => $this->options['footable']['breakpoint'][$name] ?? [],
in src/Plugin/views/style/FooTable.php

Seems to work.

🐛 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

  • Issue created by @fnapo
  • First commit to issue fork.
  • @shalini_jha opened merge request.
  • @shalini_jha opened merge request.
  • @shalini_jha opened merge request.
  • @shalini_jha opened merge request.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India shalini_jha

    Hi @fnapo
    I have added an MR for the fixes, please review.
    Thanks

Production build 0.71.5 2024