fixed home computed fields
This commit is contained in:
		@@ -42,8 +42,10 @@ class ComputedArticlesReferences extends EntityReferenceFieldItemList
 | 
				
			|||||||
        ->range(0,12)
 | 
					        ->range(0,12)
 | 
				
			||||||
        ->condition('type', 'article');
 | 
					        ->condition('type', 'article');
 | 
				
			||||||
    $nids = $query->execute();
 | 
					    $nids = $query->execute();
 | 
				
			||||||
    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++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -42,8 +42,10 @@ class ComputedCommerceProductReferences extends EntityReferenceFieldItemList
 | 
				
			|||||||
        // ->condition('type', 'article')
 | 
					        // ->condition('type', 'article')
 | 
				
			||||||
        ->range(0,12);
 | 
					        ->range(0,12);
 | 
				
			||||||
    $ids = $query->execute();
 | 
					    $ids = $query->execute();
 | 
				
			||||||
    foreach ($ids as $key => $id) {
 | 
					    $i = 0;
 | 
				
			||||||
      $this->list[$key] = $this->createItem($key, $id);
 | 
					    foreach ($ids as $id) {
 | 
				
			||||||
 | 
					      $this->list[$i] = $this->createItem($i, $id);
 | 
				
			||||||
 | 
					      $i++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,11 +45,13 @@ class ComputedShowroomsReferences extends EntityReferenceFieldItemList
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    $tids = $query->execute();
 | 
					    $tids = $query->execute();
 | 
				
			||||||
    shuffle($tids);
 | 
					    shuffle($tids);
 | 
				
			||||||
    foreach ($tids as $key => $tid) {
 | 
					    $i=0;
 | 
				
			||||||
 | 
					    foreach ($tids as $tid) {
 | 
				
			||||||
      $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
 | 
					      $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
 | 
				
			||||||
      $sid = WorkflowManager::getCurrentStateId($term, 'field_workflow');
 | 
					      $sid = WorkflowManager::getCurrentStateId($term, 'field_workflow');
 | 
				
			||||||
      if($sid != 'workflow_visible') continue;
 | 
					      if($sid != 'workflow_visible') continue;
 | 
				
			||||||
      $this->list[$key] = $this->createItem($key, $tid);
 | 
					      $this->list[$i] = $this->createItem($i, $tid);
 | 
				
			||||||
 | 
					      $i++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user