From 8a280619ad8d8fb1ea61d067f3a500b8ebbe6f6f Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 25 Aug 2021 12:14:22 +0200 Subject: [PATCH] DbObjectStore: load by ID for int keys --- library/Director/Data/Db/DbObjectStore.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Director/Data/Db/DbObjectStore.php b/library/Director/Data/Db/DbObjectStore.php index f85ff4e0..50950590 100644 --- a/library/Director/Data/Db/DbObjectStore.php +++ b/library/Director/Data/Db/DbObjectStore.php @@ -67,7 +67,11 @@ class DbObjectStore } $modification = null; try { - $object = $class::load($key, $this->connection); + if (is_int($key)) { + $object = $class::loadWithAutoIncId($key, $this->connection); + } else { + $object = $class::load($key, $this->connection); + } if ($branchStore && $modification = $branchStore->eventuallyLoadModification( $object->get('id'), $this->branch->getUuid()