Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate / src / Plugin / migrate / source / SqlBase.php
index 08653b2332b6d0bdce60d079d42a1e27b468c401..91bbcb4cf6b6d134c2e48af6779c973517dda6bd 100644 (file)
@@ -346,7 +346,9 @@ abstract class SqlBase extends SourcePluginBase implements ContainerFactoryPlugi
     if (($this->batchSize > 0)) {
       $this->query->range($this->batch * $this->batchSize, $this->batchSize);
     }
-    return new \IteratorIterator($this->query->execute());
+    $statement = $this->query->execute();
+    $statement->setFetchMode(\PDO::FETCH_ASSOC);
+    return new \IteratorIterator($statement);
   }
 
   /**
@@ -379,7 +381,7 @@ abstract class SqlBase extends SourcePluginBase implements ContainerFactoryPlugi
    * {@inheritdoc}
    */
   public function count($refresh = FALSE) {
-    return $this->query()->countQuery()->execute()->fetchField();
+    return (int) $this->query()->countQuery()->execute()->fetchField();
   }
 
   /**