Browse Source

hidden entries which are not published from entreesblock

Bachir Soussi Chiadmi 6 years ago
parent
commit
eb67107607

+ 5 - 0
sites/all/modules/figli/edlp_corpus/src/Plugin/Block/BlockEntrees.php

@@ -8,6 +8,7 @@ namespace Drupal\edlp_corpus\Plugin\Block;
 use Drupal\Core\Block\BlockBase;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
+use Drupal\workflow\Entity\WorkflowManager;
 
 /**
  * Creates a 'Entrees' Block
@@ -34,6 +35,10 @@ class BlockEntrees extends BlockBase {
       $tid = $term->id();
       $name = $term->getName();
 
+      // remove masqué
+      $sid = WorkflowManager::getCurrentStateId($term, 'field_workflow');
+      if($sid == 'generique_masque') continue;
+
       $entree = array(
         'tid'=>$tid
       );