Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to main #150

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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