update allmapitemsof with fake creation family id
This commit is contained in:
+12
-4
@@ -210,10 +210,18 @@ class EnFrSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|||||||
$builder->compose(
|
$builder->compose(
|
||||||
$builder->callback(function($parent, $arg){
|
$builder->callback(function($parent, $arg){
|
||||||
$entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
$entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
||||||
$query = $entity_storage->getQuery()
|
$query = $entity_storage->getQuery();
|
||||||
->condition('type', ['texte', 'texte_prod'], 'IN')
|
// creations have no family, return creation for id == 0
|
||||||
->condition('field_famille', $arg)
|
if ($arg['familyId'] == 0) {
|
||||||
->accessCheck(TRUE);
|
$query
|
||||||
|
->condition('type', ['creation'], 'IN')
|
||||||
|
->accessCheck(TRUE);
|
||||||
|
} else {
|
||||||
|
$query
|
||||||
|
->condition('type', ['texte', 'texte_prod'], 'IN')
|
||||||
|
->condition('field_famille', $arg)
|
||||||
|
->accessCheck(TRUE);
|
||||||
|
}
|
||||||
$results = $query->execute();
|
$results = $query->execute();
|
||||||
return $results;
|
return $results;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user