- 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin
This will cause undefined Arrey key (#id) error in Drupal 9.5 and higher.
I'm using the module
Fixed Block Content →
which
provides a way of having permanent custom content blocks without broken instances if the block does not exist.
When Twig Template Suggester is enabled and I land on a page with a fixed block, I get this error:
Error: Call to a member function getRegion() on null in twigsuggest_theme_suggestions_block() (line 30 of modules/contrib/twigsuggest/twigsuggest.module).
The issue lies in the block not being loaded (NULL
): $block = Block::load($variables['elements']['#id'])
Its ID comes in a different format: fixed_block_content:my__block_machine_name
.
Adding a simple check sorts the issue. Patch attached.
Fixed
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This will cause undefined Arrey key (#id) error in Drupal 9.5 and higher.