fields() function broken

Created on 30 January 2024, 5 months ago

Problem/Motivation

Call to a member function getColumnNames() on null, because $this->file doesnโ€™t exist

Steps to reproduce

When calling dr migrate:fields-source, the error above appears

Proposed resolution

   public function fields() {
+    $result = $this->getQueryResults();
     $fields = [];
-    if (!$this->file) {
-      $this->initializeIterator();
+    foreach ($result->fetchAssoc() as $key => $column) {
+      $fields[$key] = $key;
     }
-    foreach ($this->file->getColumnNames() as $column) {
-      $fields[key($column)] = reset($column);
-    }
-
-    // Any caller-specified fields with the same names as extracted fields will
-    // override them; any others will be added.
-    $fields = $this->getConfiguration()['fields'] + $fields;
 
     return $fields;
   }

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs review

Version

1.3

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany Gogowitsch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024