Skip to content
Snippets Groups Projects
Commit 0e99d049 authored by Nikolay Grachev's avatar Nikolay Grachev Committed by Nikolay Grachev
Browse files

Issue #3446352: hide the block for not Published IF page is node

parent d6217ac0
No related branches found
No related tags found
No related merge requests found
......@@ -113,12 +113,18 @@ class NodePublishedState extends ConditionPluginBase implements ContainerFactory
// Ignore if all checkboxes unchecked.
return TRUE;
}
/** @var \Drupal\node\NodeStorageInterface$node_storage */
$node_storage = $this->entityTypeManager->getStorage('node');
/** @var \Drupal\node\NodeInterface $node */
$node = $this->getContextValue('node');
if (empty($node)) {
// Ignore if node context isn't available.
return TRUE;
}
/** @var \Drupal\node\NodeStorageInterface$node_storage */
$node_storage = $this->entityTypeManager->getStorage('node');
$vid = $node_storage->getLatestRevisionId($node->id());
/** @var \Drupal\Core\Entity\RevisionableInterface $node_revision */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment