Problem/Motivation
Immediately upon enabling the module in Drupal 9.3.12 with PHP 8.0.18:
php Error AssertionError: Cannot load the "view" entity with NULL ID. in assert() (line 295 of
/app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php) #0 /app/web/core/lib/Drupal/Core/Entity/Ent
php Warning Warning: Undefined array key "#parent_view" in views_fields_on_off_preprocess_views_exposed_form() (line 43 of
/app/web/modules/contrib/views_fields_on_off/views_fields_on_off.module) #0 /
Steps to reproduce
Enable the module, then navigate to a View that does not implement the module, such as /admin/reports/status.
Proposed resolution
At line 43 of views_field_on_off.module, add
if (!isset($variables['form']) || !isset($variables['form']['#parent_view'])) {
return;
}
Remaining tasks
make a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | views_fields_on_off-3279508-2-undefined-array-key.patch | 618 bytes | benstallings |
Comments
Comment #2
benstallings commentedHere's a patch.
Comment #4
andileco commented