Skip to content

Firefly III: a personal finances manager

More debug, some bug fixes.

James Cole8e61e129abd3
diff --git a/app/Helpers/Csv/Mapper/AnyAccount.php b/app/Helpers/Csv/Mapper/AnyAccount.php
index 36fe8b20ed..970a243a2b 100644
--- a/app/Helpers/Csv/Mapper/AnyAccount.php
+++ b/app/Helpers/Csv/Mapper/AnyAccount.php
@@ -27,7 +27,9 @@ class AnyAccount implements MapperInterface
}
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
+
+ //array_unshift($list, );
return $list;
}
diff --git a/app/Helpers/Csv/Mapper/AssetAccount.php b/app/Helpers/Csv/Mapper/AssetAccount.php
index 6915533ea7..2c40de3ea9 100644
--- a/app/Helpers/Csv/Mapper/AssetAccount.php
+++ b/app/Helpers/Csv/Mapper/AssetAccount.php
@@ -38,7 +38,7 @@ class AssetAccount implements MapperInterface
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
diff --git a/app/Helpers/Csv/Mapper/Bill.php b/app/Helpers/Csv/Mapper/Bill.php
index 45f2de5897..45c5522f0f 100644
--- a/app/Helpers/Csv/Mapper/Bill.php
+++ b/app/Helpers/Csv/Mapper/Bill.php
@@ -27,7 +27,7 @@ class Bill implements MapperInterface
}
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
diff --git a/app/Helpers/Csv/Mapper/Budget.php b/app/Helpers/Csv/Mapper/Budget.php
index dbe8ebb03c..ee8afac4a2 100644
--- a/app/Helpers/Csv/Mapper/Budget.php
+++ b/app/Helpers/Csv/Mapper/Budget.php
@@ -27,7 +27,7 @@ class Budget implements MapperInterface
}
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
diff --git a/app/Helpers/Csv/Mapper/Category.php b/app/Helpers/Csv/Mapper/Category.php
index 7244a65a1a..1d8ec5f240 100644
--- a/app/Helpers/Csv/Mapper/Category.php
+++ b/app/Helpers/Csv/Mapper/Category.php
@@ -27,7 +27,7 @@ class Category implements MapperInterface
}
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
diff --git a/app/Helpers/Csv/Mapper/Tag.php b/app/Helpers/Csv/Mapper/Tag.php
index 559c73089c..dccb19956a 100644
--- a/app/Helpers/Csv/Mapper/Tag.php
+++ b/app/Helpers/Csv/Mapper/Tag.php
@@ -27,7 +27,7 @@ class Tag implements MapperInterface
}
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
diff --git a/app/Helpers/Csv/Mapper/TransactionCurrency.php b/app/Helpers/Csv/Mapper/TransactionCurrency.php
index 4d6281acdc..93a9ddacc3 100644
--- a/app/Helpers/Csv/Mapper/TransactionCurrency.php
+++ b/app/Helpers/Csv/Mapper/TransactionCurrency.php
@@ -25,7 +25,7 @@ class TransactionCurrency implements MapperInterface
asort($list);
- array_unshift($list, trans('firefly.csv_do_not_map'));
+ $list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
diff --git a/app/Helpers/Csv/Specifix/RabobankDescription.php b/app/Helpers/Csv/Specifix/RabobankDescription.php
index 7cf96bdd68..f2b5c9f58d 100644
--- a/app/Helpers/Csv/Specifix/RabobankDescription.php
+++ b/app/Helpers/Csv/Specifix/RabobankDescription.php
@@ -35,13 +35,15 @@ class RabobankDescription
protected function rabobankFixEmptyOpposing()
{
Log::debug('RaboSpecifix: Opposing account name is "' . $this->data['opposing-account-name'] . '".');
- if (strlen($this->data['opposing-account-name']) == 0) {
+ if (is_string($this->data['opposing-account-name']) && strlen($this->data['opposing-account-name']) == 0) {
Log::debug('RaboSpecifix: opp-name is zero length, changed to: "' . $this->row[10] . '"');
$this->data['opposing-account-name'] = $this->row[10];
+
+ Log::debug('Description was: "' . $this->data['description'] . '".');
+ $this->data['description'] = trim(str_replace($this->row[10], '', $this->data['description']));
+ Log::debug('Description is now: "' . $this->data['description'] . '".');
}
- Log::debug('Description was: "' . $this->data['description'] . '".');
- $this->data['description'] = trim(str_replace($this->row[10], '', $this->data['description']));
- Log::debug('Description is now: "' . $this->data['description'] . '".');
+
}
/**