Skip to content
Snippets Groups Projects

Resolve #3446187 "Add gitlab ci"

Files
12
+ 6
5
@@ -32,19 +32,20 @@ class TocFilterBlock extends TocBlockBase {
// Node should have [toc] token or filter should have auto enabled.
$format_id = $node->body->format;
if ($format_id !== NULL){
$format = FilterFormat::load($format_id);
if ( $format && $format->filters('toc_filter')) {
if ($format_id !== NULL) {
$format = FilterFormat::load($format_id);
if ($format && $format->filters('toc_filter')) {
$toc_filter_config = $format->filters('toc_filter')->getConfiguration();
// If auto is disabled, and there is no [toc token, don't display block.
if (!$toc_filter_config['settings']['auto'] && stripos($node->body->value, '[toc') === FALSE) {
return AccessResult::forbidden();
}
}
} else {
}
else {
return AccessResult::forbidden();
}
// Since entities (ie node) are cached we need to pass the current node's
// body through it's filters and see if a TOC is being generated and
// displayed in this block.
Loading