Skip to content
Snippets Groups Projects
Commit bb435b57 authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3293922 by shobhit91, smustgrave: Call to a member function getRenderArray() on null

parent 0452d8f8
No related branches found
No related tags found
3 merge requests!21Issue #3407343 Add theme template for loading animation/markup,!14Issue #3189439: Last clicked tab history should be configurable,!11Issue #3238148: Tabs still displayed even when empty
Pipeline #430152 passed with warnings
......@@ -5,6 +5,7 @@ namespace Drupal\quicktabs\Plugin\Block;
use Drupal\block_content\Plugin\Derivative\BlockContent;
use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
......@@ -21,6 +22,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
)]
class QuickTabsBlock extends BlockBase implements ContainerFactoryPluginInterface {
use LoggerChannelTrait;
/**
* Constructs a BlockComponentRenderArray object.
*
......@@ -52,11 +55,8 @@ class QuickTabsBlock extends BlockBase implements ContainerFactoryPluginInterfac
$qt = $this->entityTypeManager->getStorage('quicktabs_instance')->load($qt_id);
if (!isset($qt)) {
return [
'#markup' => $this->t('Broken QuickTabs block with ID: @id', [
'@id' => $this->getDerivativeId(),
]),
];
$this->getLogger('quicktabs')->warning('Broken QuickTabs block. QuickTabs block does not exist.');
return [];
}
return $qt->getRenderArray();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment