We're using block_field to place a block in a Paragraph (for some complicated layout), but the usdws base theme breaks the page ("The website encountered an unexpected error. Please try again later.")
In the error logs, we have "Notice: Undefined index: #id in uswds_preprocess_block() (line 21" followed by "Warning: assert(): Cannot load a NULL ID"
Lines 21 & 22 of block.preprocess.inc
if (!in_array($variables['plugin_id'], $no_grid)) {
$block = \Drupal\block\Entity\Block::load($variables['elements']['#id']);
Line 21 should also be checking for the existence of $variables['elements']['#id'] before attempting to load that as a block.
Comments
Comment #2
nels commentedComment #3
brian.seek commentedI have tested this patch and it seems to fix the issue.
Comment #4
nels commentedI think this new patch applies better. My inexperience in patching is showing.
Comment #5
Irisibk commentedThis patch is for the 8.x-2.x version.
Comment #6
brian.seek commentedComment #7
richgerdesThis patch was committed.
https://git.drupalcode.org/project/uswds/-/commit/9d7f471a86696dd578389b....
Comment #8
jrglasgow commented