Skip to content

Commit b29765f

Browse files
committed
Skip unsupported array values during import
1 parent ecd27fe commit b29765f

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Version 2.22.0
2+
3+
Compatibility: requires minimum Kimai 2.36.0
4+
5+
- Skip unsupported array values during project/customer JSON import
6+
17
## Version 2.21.0
28

39
Compatibility: requires minimum Kimai 2.36.0

Importer/CustomerImporter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ private function convertEntryToCustomer(array $entry): Customer
170170
private function mapEntryToCustomer(Customer $customer, array $row): void
171171
{
172172
foreach ($row as $key => $value) {
173+
if (\is_array($value)) {
174+
continue;
175+
}
173176
if ($value !== null) {
174177
$value = trim($value);
175178
}

Importer/GrandtotalCustomerImporter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ private function mapEntryToCustomer(Customer $customer, array $row): void
160160
$address = ['street' => '', 'city' => '', 'code' => ''];
161161

162162
foreach ($row as $name => $value) {
163+
if (\is_array($value)) {
164+
continue;
165+
}
163166
if ($value !== null) {
164167
$value = trim($value);
165168
}

Importer/ProjectImporter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ private function findCustomer(array $entry): Customer
227227
private function mapEntryToProject(Project $project, array $row): void
228228
{
229229
foreach ($row as $name => $value) {
230+
if (\is_array($value)) {
231+
continue;
232+
}
230233
if ($value !== null) {
231234
$value = trim($value);
232235
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Import data from CSV files via Web UI",
44
"homepage": "https://www.kimai.org/store/keleo-importer-bundle.html",
55
"type": "kimai-plugin",
6-
"version": "2.21.0",
6+
"version": "2.22.0",
77
"keywords": [
88
"kimai",
99
"kimai-plugin"

0 commit comments

Comments
 (0)