Drupal 8: Re-run cron while it is already running
# Execute `php-eval` drush's command to release cron's flag
drush php-eval "\Drupal::lock()->release('cron');"


Load all taxonomy vocabularies


Load taxonomy tree based on vocabulary


Pantheon - Drupal 8 + Upstream Updates
# Official Pantheon documentation reference here:
 git pull -Xtheirs git:// master


Drupal 8 Load EntityViewDisplay instance

use Drupal\Core\Entity\Entity\EntityViewDisplay;

// Define values to load entity
$entity_type = 'node';
$bundle = 'article';
$view_mode = 'teaser';

// Setup entity view display ID
$entity_id = sprintf('%s.%s.%s', $entity_type, $bundle, $view_mode);

// Load entity view display object using entity id.
$entityViewDisplay = EntityViewDisplay::load($entity_id);


Drupal 8 countQuery()
$result = \Drupal::database()->select('node')
  ->condition('type', 'article')


Drupal 8 Delete all content by code
// Define entity type to lookup.
$entity_type = 'node';

// Execute a query in order to retrieve an array of Article's ids.
$ids = \Drupal::entityQuery($entity_type)
  ->condition('type', 'article')

/** @var \Drupal\node\NodeStorage $controller */
$controller = \Drupal::entityTypeManager()

/** @var \Drupal\node\Entity\Node[] $entities */
$entities = $controller->loadMultiple($ids);

// Deletes permanently saved entities.


Git Add New Remote
git remote add  [REMOTE_NAME] [REPOSITORY_URL]
git push -u github master


Git reset changes
git reset --hard


Drupal 8: Mismatched entity and/or field definitions
drush updb --entity-updates


drush entity-updates command


drush entup