Skip to content
Snippets Groups Projects
Commit d6217ac0 authored by Virendra Singh's avatar Virendra Singh Committed by Nikolay Grachev
Browse files

Issue #3412884 by viren18febS, AbdeI, clarkssquared: Fix the issues reported by phpcs

parent 5991600d
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,11 @@ A module that provides a condition plugin for blocks.
Allows to display block on pages depending on publishing status of the node.
For example, a block can be shown for editors on unpublished pages only.
Supports both classic _Published/Unpublished_ status and workflows (_Review, Draft..._ etc.) as well.
Supports both classic _Published/Unpublished_ status and workflows
(_Review, Draft..._ etc.) as well.
In case of workflows, all states such as _Draft, Unpublished, Review..._ are treated as unpublished,
In case of workflows, all states such as _Draft, Unpublished, Review..._
are treated as unpublished,
state _Published_ is treated as published content.
......
......@@ -2,7 +2,6 @@
namespace Drupal\block_condition_published\Plugin\Condition;
use Drupal\Core\Condition\Annotation\Condition;
use Drupal\Core\Condition\ConditionPluginBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
......@@ -11,7 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a 'Node Published State' condition.
*
* @Condition(
* id = "node_published_state",
* label = @Translation("Node published state"),
......@@ -126,9 +125,8 @@ class NodePublishedState extends ConditionPluginBase implements ContainerFactory
$node_revision = $node_storage->loadRevision($vid);
// @todo more info about revisions:
// https://www.phase2technology.com/blog/getting-correct-node
// https://drupal.stackexchange.com/questions/264674/what-is-the-default-revision
// https://www.phase2technology.com/blog/getting-correct-node
// https://drupal.stackexchange.com/questions/264674/what-is-the-default-revision
return $node_revision->get('status')->value == $this->configuration['is_published'];
}
......
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