- Assigned to samit.310@gmail.com
- Status changed to Needs work
over 1 year ago 12:43pm 17 August 2023 - Issue was unassigned.
- Status changed to Postponed: needs info
over 1 year ago 12:51pm 17 August 2023 - 🇮🇳India samit.310@gmail.com
Hi @lucian_pana,
I tried to reproduce it, but not able to.
I am not sure why are you getting this error because in the following form field, the default value is array. SO the null given in array_filter() is not possible.
$form['local_task_enabled_entity_types']['entity_types'] = [ '#type' => 'checkboxes', '#title' => $this->t('Local task entity types'), '#options' => $tabs_options, '#default_value' => $config->get('local_task_enabled_entity_types') ?: [], ];
Please check again.
Thanks
Samit K. - 🇳🇱Netherlands Drumanuel
Same problem here
Entity Usage 8.x-2.0-beta12
Drupal core 10.2.2TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 273 of modules/contrib/entity_usage/src/Form/EntityUsageSettingsForm.php).
- 🇮🇳India dineshkumarbollu
Hi
I try to reproduce the issue in Drupal 10.2 with Entity Usage 8.x-2.0-beta12 i am not getting any error. Configurations saved successfully. - 🇩🇪Germany stmh
I am experiencing the same error. The provided snippet fixes it for me.
- Status changed to Needs review
5 months ago 3:53pm 23 July 2024 - 🇨🇦Canada smulvih2 Canada 🍁
The issue is with this code on line 273:
array_filter($config->get('local_task_enabled_entity_types'))
When you first install the module and go to configure it,
$config->get('local_task_enabled_entity_types')
will be NULL. So adding a simple?? []
to ensure array_filter() has an empty array in this case would make sense.