Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / file / src / Plugin / migrate / source / d7 / File.php
index 5e88151229ade20e0f5710a10bb80b61574bfec4..c0da770b70a769ed3ee85ed21418985e54bdc536 100644 (file)
@@ -43,18 +43,21 @@ class File extends DrupalSqlBase {
   public function query() {
     $query = $this->select('file_managed', 'f')
       ->fields('f')
+      ->condition('uri', 'temporary://%', 'NOT LIKE')
       ->orderBy('f.timestamp');
 
     // Filter by scheme(s), if configured.
     if (isset($this->configuration['scheme'])) {
       $schemes = [];
+      // Remove 'temporary' scheme.
+      $valid_schemes = array_diff((array) $this->configuration['scheme'], ['temporary']);
       // Accept either a single scheme, or a list.
-      foreach ((array) $this->configuration['scheme'] as $scheme) {
+      foreach ((array) $valid_schemes as $scheme) {
         $schemes[] = rtrim($scheme) . '://';
       }
       $schemes = array_map([$this->getDatabase(), 'escapeLike'], $schemes);
 
-      // uri LIKE 'public://%' OR uri LIKE 'private://%'
+      // Add conditions, uri LIKE 'public://%' OR uri LIKE 'private://%'.
       $conditions = new Condition('OR');
       foreach ($schemes as $scheme) {
         $conditions->condition('uri', $scheme . '%', 'LIKE');