From d758516042a2ab094dd9d8272c7d3516b8c1fe31 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 27 Nov 2023 11:23:30 +0100 Subject: [PATCH] fix: [Attribute:editPostProcessing] Fixed sighting capture --- app/Model/Attribute.php | 2 +- app/Model/Sighting.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index 0d21bc3ea..9da42bb1b 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -2712,7 +2712,7 @@ class Attribute extends AppModel } $attributeId = $this->updateLookupTable[$attribute['uuid']]; if (!empty($attribute['Sighting'])) { - $this->Sighting->captureSightings($attribute['Sighting'], $this->id, $eventId, $user); + $this->Sighting->captureSightings($attribute['Sighting'], $attributeId, $eventId, $user); } if ($user['Role']['perm_tagger']) { /* diff --git a/app/Model/Sighting.php b/app/Model/Sighting.php index abec16f63..d19148bf8 100644 --- a/app/Model/Sighting.php +++ b/app/Model/Sighting.php @@ -152,7 +152,7 @@ class Sighting extends AppModel $toSave = []; foreach ($sightings as $sighting) { - if (isset($existingSighting[$sighting['uuid']])) { + if (!empty($sighting['uuid']) && isset($existingSighting[$sighting['uuid']])) { continue; // already exists, skip }