From d30dd19b70fce6368f2b2f42acb0f830ca3b3359 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sun, 17 Sep 2017 10:14:14 +1000 Subject: [PATCH] Rollback 510071550a0f1b564d16b28922e9ef5f8c10d4a9 This issue has been addressed too early in the process lifecycle. The line number should be incremented later, say in the view layer when the error is displayed. A simple helper to determine what the index increment should do well. $row + $indexIncrement This is so we don't have to rebuild the array, which is computationally expensive for large datasets and could be frustrating for a developer expecting untouched index values, or likewise needing to prepare our special format. --- modules/backend/models/ImportModel.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/backend/models/ImportModel.php b/modules/backend/models/ImportModel.php index 334734d2f..55f6512ad 100644 --- a/modules/backend/models/ImportModel.php +++ b/modules/backend/models/ImportModel.php @@ -146,16 +146,6 @@ abstract class ImportModel extends Model foreach ($contents as $row) { $result[] = $this->processImportRow($row, $matches); } - - // Offset the array index in order to have the correct row index in error logs - if ($options['firstRowTitles']) { - array_unshift($result, [], []); - unset($result[0]); - unset($result[1]); - } else { - array_unshift($result, []); - unset($result[0]); - } return $result; }