fix CSV import asking for cols that were removed

pull/35/head
Ondřej Hruška 6 years ago
parent bc960e80aa
commit 2cadbdcd31
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      app/Http/Controllers/TableEditController.php
  2. 4
      app/Tables/Changeset.php

@ -129,7 +129,7 @@ class TableEditController extends Controller
return view('table.propose.add-rows-csv', [ return view('table.propose.add-rows-csv', [
'changeset' => $changeset, 'changeset' => $changeset,
'table' => $changeset->table, 'table' => $changeset->table,
'columns' => collect($columns), 'columns' => collect($columns)->where('toRemove', false),
]); ]);
} }

@ -643,8 +643,10 @@ class Changeset
*/ */
public function addFilledRows($csvArray) public function addFilledRows($csvArray)
{ {
$columns = collect($this->fetchAndTransformColumns())->where('toRemove', false);
/** @var Column[] $columns */ /** @var Column[] $columns */
$columns = array_values($this->fetchAndTransformColumns()); $columns = $columns->values()->all();
$rows = self::csvToRowsArray($columns, $csvArray, false, true) $rows = self::csvToRowsArray($columns, $csvArray, false, true)
->keyBy('_id'); ->keyBy('_id');

Loading…
Cancel
Save