Skip to content

Commit

Permalink
Fix Update
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Hamann <[email protected]>
  • Loading branch information
tacruc committed Jan 23, 2023
1 parent 59c0efb commit eb71aa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/DB/GeophotoMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ public function deleteAll($userId) {
public function updateByFileId($fileId, $lat, $lng) {
$qb = $this->db->getQueryBuilder();

$qb->update($this->getTableName())->set('lat', $qb->createNamedParameter($lat)
)->set('lng', $qb->createNamedParameter($lng)
)->where('file_id', $qb->createNamedParameter($fileId));
$qb->update($this->getTableName())
->set('lat', $qb->createNamedParameter($lat))
->set('lng', $qb->createNamedParameter($lng))
->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)));

return $qb->executeStatement();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/PhotofilesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function updateByFileNow(Node $file) {
$this->updatePhoto($file, $exif);
$this->photosCache->clear($ownerId);
$this->nonLocalizedPhotosCache->clear($ownerId);
} catch (DoesNotExistException) {
} catch (DoesNotExistException $exception) {
$this->insertPhoto($file, $ownerId, $exif);
}
}
Expand Down Expand Up @@ -311,7 +311,7 @@ public function addPhotoNow($photo, $userId) {
// OR by using file_id in primary key
try {
$this->photoMapper->findByFileIdUserId($photo->getId(), $userId);
} catch (DoesNotExistException) {
} catch (DoesNotExistException $exception) {
$this->insertPhoto($photo, $userId, $exif);
}
$this->photosCache->clear($userId);
Expand Down

0 comments on commit eb71aa9

Please sign in to comment.