WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

The import failed due to the following reasons: These entities need to be deleted before importing.

Submitted by barnettech on Tue, 04/09/2019 - 10:04

The import failed due to the following reasons:
Entities exist of type Taxonomy term
and Vocabulary er">Complinet Titles. These entities need to be deleted befo
re importing.
Entities exist of type Taxonomy term
and Vocabulary er">Complinet Rules. These entities need to be deleted befor
e importing.

Drupal 8 basic query work

Submitted by barnettech on Sun, 02/17/2019 - 14:43
    $connection = \Drupal::database();
    $query = $connection->query("SELECT * FROM {node} n WHERE type > :type", [
      ':type' => 'article',
    ]);
    $result = $query->fetchAll();
    foreach ($result as $item) {
      $node = \Drupal\node\Entity\Node::load($item->nid);
      //dpm($node);
      $title = $node->get('title')->getValue();
      $title = $title[0]['value']);

  $database = \Drupal::database();
  foreach ($roles as $role) {
    $query = $database->select('role_terms', 'rt');
    $query->condition('rt.uid', $userCurrentId);