Skip to content

Instantly share code, notes, and snippets.

@crittermike
Created June 7, 2020 03:22
Show Gist options
  • Save crittermike/7233a55079cd112d51d44ce0d1939ec6 to your computer and use it in GitHub Desktop.
Save crittermike/7233a55079cd112d51d44ce0d1939ec6 to your computer and use it in GitHub Desktop.

Revisions

  1. crittermike revised this gist Jun 7, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions test.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    <?php

    $query = \Drupal::entityQuery('node');
    $ids = $query->accessCheck(FALSE)->execute();
    $storage_handler = \Drupal::entityTypeManager()->getStorage('node');
  2. crittermike created this gist Jun 7, 2020.
    9 changes: 9 additions & 0 deletions test.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    $query = \Drupal::entityQuery('node');
    $ids = $query->accessCheck(FALSE)->execute();
    $storage_handler = \Drupal::entityTypeManager()->getStorage('node');
    // If you have a lot of nodes, you may have to split this up via
    // array_chunk() instead of trying to load all nodes at one time.
    $entities = $storage_handler->loadMultiple($ids);
    foreach ($entities as $entity) { 
    taxonomy_build_node_index($entity); 
    }