fixed thematiques display
This commit is contained in:
@@ -107,7 +107,7 @@ class Base extends ControllerBase {
|
||||
private function defaultQuery(){
|
||||
$entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
$this->query = $entity_storage->getQuery()
|
||||
->condition('type', 'materiau')
|
||||
->condition('type', ['materiau', 'thematique'], 'IN')
|
||||
->condition('status', '1')
|
||||
->range($this->offset, $this->limit)
|
||||
->accessCheck(TRUE)
|
||||
@@ -116,7 +116,7 @@ class Base extends ControllerBase {
|
||||
$this->results = $this->query->execute();
|
||||
|
||||
$this->count_query = $entity_storage->getQuery()
|
||||
->condition('type', 'materiau')
|
||||
->condition('type', ['materiau', 'thematique'], 'IN')
|
||||
->accessCheck(TRUE)
|
||||
->condition('status', '1')
|
||||
->count();
|
||||
@@ -191,18 +191,18 @@ class Base extends ControllerBase {
|
||||
$nids = [];
|
||||
// Using entityTypeManager
|
||||
// Get a node storage object.
|
||||
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
// $node_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||
|
||||
foreach ($this->results as $result) {
|
||||
$lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// $lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// Load a single node.
|
||||
$node = $node_storage->load($result);
|
||||
// $node = $node_storage->load($result);
|
||||
// check if has translation
|
||||
|
||||
if ($node->hasTranslation($lang)) {
|
||||
// $uuids[] = $result->getField('uuid')->getValues()[0];
|
||||
// i used to filter like bellow because of a graphql probleme
|
||||
// if ($node->hasTranslation($lang)) {
|
||||
$nids[] = $result;
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
// $resp['uuids'] = $uuids;
|
||||
|
Reference in New Issue
Block a user