Error in decision block when no block is selected

Created on 14 February 2023, over 1 year ago

Problem/Motivation

If a decision block has no block selected, the error is:
'Error: Call to a member function getPluginId() on null in Drupal\smart_content_block\Plugin\Block\DecisionBlock->build() (line 107 of modules/contrib/smart_content/modules/smart_content_block/src/Plugin/Block/DecisionBlock.php).'

Steps to reproduce

Create a smart content block, with no decision block->View page.

Proposed resolution

Do a null check on the object before attempting to call function.

User interface changes

None

Have attached a patch, might require re-rolling. But it does work for us.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand atowl

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

Comments & Activities

Production build 0.69.0 2024