- Issue created by @richardhobbs
- Status changed to RTBC
over 1 year ago 7:25am 14 July 2023 Verified and tested the block-class.patch → on 2.0.11 , warning is fixable by adding patch. Added screenshot for reference.
Can be moved to RTBC+1.
Warning: foreach() argument must be of type array|object, null given in /app/htdocs/modules/contrib/block_class/src/Controller/BlockClassController.php on line 282
Drupal version 10.1.1
The above error is displayed when you visit this page
admin/config/content/block-class/class-list
Move the foreach() into an if statement
if ($block_classes_stored != NULL) {
// Get the array values and id in the keys.
$block_classes_stored = array_values($block_classes_stored);
foreach ($block_classes_stored as $block_class) {
$table .= '<tr>';
$table .= '<td>' . $block_class . '</td>';
$table .= '</tr>';
}
}
2.0
Code
Verified and tested the block-class.patch → on 2.0.11 , warning is fixable by adding patch. Added screenshot for reference.
Can be moved to RTBC+1.