Skip to content
Snippets Groups Projects

Issue 3150381: Allow TOC in block, when the node does not contain 'body' field

Closed Winn Jewett requested to merge issue/toc_filter-3150381:3150381-only-works-with into 8.x-2.x
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -23,9 +23,9 @@ class TocFilterBlock extends TocBlockBase {
protected function blockAccess(AccountInterface $account) {
$node = $this->getCurrentNode();
// If current page is not a node or does not contain a [toc] token return
// If current page is not a node
// forbidden access result.
if (!$node || !$node->hasField('body')) {
if (!$node) {
return AccessResult::forbidden();
}
Loading