TypeError: Argument 1 passed to Drupal\block\BlockViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given

Created on 1 August 2017, almost 7 years ago
Updated 10 December 2023, 7 months ago

TypeError: Argument 1 passed to Drupal\block\BlockViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in modules/contrib/block_token/block_token.module on line 59 in Drupal\block\BlockViewBuilder->view() (line 70 of core/modules/block/src/BlockViewBuilder.php).

This happens in AJAX response when saving some webform fields at /admin/structure/webform/manage/%.

Reproduction steps:
1. Create two webforms 1 & 2.
2. Add a block for 2nd webform and activate its token (e.g. [block_token:webform:my_webform_2]).
3. In Webform 1: create Computed token field with value of: [block_token:webform:my_webform_2], then save the field.
4. Now remove the block for webforms 2, and re-add by using different machine name (so token can change to e.g. [block_token:webform:my_webform_2_other].
5. Go to Webform 1, edit Computed token field and try to change the value to [block_token:webform:my_webform_2_other].
The error should happen, as somehow the old block is loaded, before saving the new value.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom kenorb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024