Skip to content

Commit

Permalink
Merge branch 'feature/CONNECTOR-179/locking' into feature/CONNECTOR-2…
Browse files Browse the repository at this point in the history
…07/intval-bug
  • Loading branch information
rjzondervan committed Jan 30, 2025
2 parents ddd45ee + cce5b88 commit 356c886
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Db/ObjectEntityMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ObjectEntityMapper extends QBMapper
* @param IUserSession $userSession The user session
*/
public function __construct(
IDBConnection $db,
IDBConnection $db,
MySQLJsonService $mySQLJsonService,
IEventDispatcher $eventDispatcher,
IUserSession $userSession,
Expand Down Expand Up @@ -73,7 +73,7 @@ public function find($identifier): ObjectEntity
->from('openregister_objects')
->where(
$qb->expr()->orX(
$qb->expr()->eq('id', $qb->createNamedParameter($identifier, IQueryBuilder::PARAM_INT)),
$qb->expr()->eq('id', $qb->createNamedParameter(is_numeric($identifier) ? $identifier : -1, IQueryBuilder::PARAM_INT)),
$qb->expr()->eq('uuid', $qb->createNamedParameter($identifier, IQueryBuilder::PARAM_STR)),
$qb->expr()->eq('uri', $qb->createNamedParameter($identifier, IQueryBuilder::PARAM_STR))
)
Expand Down Expand Up @@ -469,10 +469,10 @@ public function lockObject($identifier, ?string $process = null, ?int $duration
* @throws DoesNotExistException If object not found
* @throws \Exception If unlocking fails
*/
public function unlockObject($identifier): ObjectEntity
public function unlockObject($identifier): ObjectEntity
{
$object = $this->find($identifier);

// Check if user has permission to unlock
if (!$this->userSession->isLoggedIn()) {
throw new \Exception('Must be logged in to unlock objects');
Expand Down

0 comments on commit 356c886

Please sign in to comment.