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('status', 1)
|
||||||
->condition('type', 'materiau')
|
->condition('type', 'materiau')
|
||||||
->exists('field_materiau_images')
|
->exists('field_materiau_images')
|
||||||
->condition('field_materiau_images.%delta', 3)
|
->condition('field_materiau_images.%delta', 3, '>')
|
||||||
->sort('created', 'DESC')
|
->sort('created', 'DESC')
|
||||||
->range(0,200);
|
->range(0,200);
|
||||||
$results = $query->execute();
|
$results = $query->execute();
|
||||||
if ($results) {
|
if ($results) {
|
||||||
$nids = array_rand($results, 100);
|
$nids = array_rand($results, 100);
|
||||||
foreach ($nids as $key => $nid) {
|
$i = 0;
|
||||||
$this->list[$key] = $this->createItem($key, $nid);
|
foreach ($nids as $nid) {
|
||||||
|
$this->list[$i] = $this->createItem($i, $nid);
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue