mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-28 06:15:39 +00:00
Fix bill edit submission group thing.
This commit is contained in:
@@ -142,7 +142,14 @@ class BillUpdateService
|
||||
$bill->objectGroups()->sync([$objectGroup->id]);
|
||||
$bill->save();
|
||||
}
|
||||
return $bill;
|
||||
}
|
||||
// remove if name is empty. Should be overruled by ID.
|
||||
if ('' === $objectGroupTitle) {
|
||||
$bill->objectGroups()->sync([]);
|
||||
$bill->save();
|
||||
}
|
||||
|
||||
// try also with ID:
|
||||
$objectGroupId = (int)($data['object_group_id'] ?? 0);
|
||||
if (0 !== $objectGroupId) {
|
||||
@@ -151,6 +158,11 @@ class BillUpdateService
|
||||
$bill->objectGroups()->sync([$objectGroup->id]);
|
||||
$bill->save();
|
||||
}
|
||||
return $bill;
|
||||
}
|
||||
if(0 === $objectGroupId) {
|
||||
$bill->objectGroups()->sync([]);
|
||||
$bill->save();
|
||||
}
|
||||
|
||||
return $bill;
|
||||
|
||||
Reference in New Issue
Block a user