Skip to content

Commit

Permalink
Merge pull request #75 from herbdool/issue-181
Browse files Browse the repository at this point in the history
Issue 181: Ensure content key exists
  • Loading branch information
demeritcowboy authored Aug 5, 2022
2 parents 673cadb + 1d1ac8f commit 2db7510
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Plugin/Block/CivicrmBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public static function create(ContainerInterface $container, array $configuratio
*/
public function build() {
$block_id = $this->getDerivativeId();
$content = \CRM_Core_Block::getContent($block_id)['content'];
$block = \CRM_Core_Block::getContent($block_id);

// Bypass Drupal SafeString escaping by setting output as already escaped.
if ($content) {
if (!empty($block['content'])) {
return [
'#markup' => Markup::create($content),
'#markup' => Markup::create($block['content']),
'#cache' => ['max-age' => 0],
];
}
Expand Down

0 comments on commit 2db7510

Please sign in to comment.