trying to fix the bad content type coming on home materials cards grid
This commit is contained in:
parent
ba5ddc9cec
commit
f2eb90d888
|
@ -41,14 +41,16 @@ class ComputedMaterialsReferences extends EntityReferenceFieldItemList
|
|||
->condition('status', 1)
|
||||
->condition('type', 'materiau')
|
||||
->exists('field_materiau_images')
|
||||
->condition('field_materiau_images.%delta', 3)
|
||||
->condition('field_materiau_images.%delta', 3, '>')
|
||||
->sort('created', 'DESC')
|
||||
->range(0,200);
|
||||
$results = $query->execute();
|
||||
if ($results) {
|
||||
$nids = array_rand($results, 100);
|
||||
foreach ($nids as $key => $nid) {
|
||||
$this->list[$key] = $this->createItem($key, $nid);
|
||||
$i = 0;
|
||||
foreach ($nids as $nid) {
|
||||
$this->list[$i] = $this->createItem($i, $nid);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue