Browse Source

entree index now does not show documents masqués

Bachir Soussi Chiadmi 6 years ago
parent
commit
12bfc68272
1 changed files with 4 additions and 0 deletions
  1. 4 0
      sites/all/modules/figli/edlp_corpus/edlp_corpus.module

+ 4 - 0
sites/all/modules/figli/edlp_corpus/edlp_corpus.module

@@ -68,6 +68,10 @@ function edlp_corpus_taxonomy_term_view(array &$build, EntityInterface $entity,
       '#items' => [],
       '#items' => [],
     );
     );
     foreach($documents as $doc){
     foreach($documents as $doc){
+      // remove masqué
+      $sid = WorkflowManager::getCurrentStateId($doc, 'field_workflow');
+      if($sid != 'corpus_documents_publie') continue;
+      // TODO: instead of workflow, just check access
       $documents_list['#items'][] = $view_builder->view($doc, 'index');
       $documents_list['#items'][] = $view_builder->view($doc, 'index');
     }
     }