- Issue created by @gogowitsch
Call to a member function getColumnNames() on null, because $this->file doesnโt exist
When calling dr migrate:fields-source
, the error above appears
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;
}
Needs review
1.3
Code