Skip to content

Commit

Permalink
Merge pull request #40 from beatrycze-volk/fix-bool
Browse files Browse the repository at this point in the history
[BUGFIX] Fix setting valus for `Access` objects
  • Loading branch information
beatrycze-volk authored Oct 8, 2024
2 parents 614efdf + 5f6e8d3 commit 53482b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Classes/Command/KitodoAccessGrantedNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function updateAccessEntry(Access $accessEntry, $notificationTimestamp
{
// update access entry with notification time
$accessEntry->setAccessGrantedNotification($notificationTimestamp);

Check failure on line 110 in Classes/Command/KitodoAccessGrantedNotification.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #1 $accessGrantedNotification of method Slub\DigasFeManagement\Domain\Model\Access::setAccessGrantedNotification() expects int, string given.
$accessEntry->setInformUser(0);
$accessEntry->setInformUser(false);
$this->AccessRepository->update($accessEntry);
}

Expand Down
8 changes: 4 additions & 4 deletions Classes/Controller/AccessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function informUserAction(User $user)
/** @var Access $documentAccess */
foreach ($user->getKitodoDocumentAccess() as $documentAccess) {
if (!$documentAccess->getInformUser()) {
$documentAccess->setInformUser(1);
$documentAccess->setInformUser(true);
$this->accessRepository->update($documentAccess);
}
}
Expand Down Expand Up @@ -402,13 +402,13 @@ public function rejectAction(Access $access, User $user)
return;
}

$access->setHidden(1);
$access->setRejected(1);
$access->setHidden(true);
$access->setRejected(true);
$access->setStartTime(0);
$access->setEndTime(0);
$access->setExpireNotification(0);
$access->setAccessGrantedNotification(0);
$access->setInformUser(0);
$access->setInformUser(false);

if ($access->getRejectedReason()) {
$rejectedReason = strip_tags($access->getRejectedReason());
Expand Down
6 changes: 3 additions & 3 deletions Classes/Controller/BasketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ public function requestAction()
foreach ($this->documents['rejectedDocumentRequests'] as $accessRejectedNewRequest) {
$accessRejectedNewRequest->setExpireNotification(0);
$accessRejectedNewRequest->setAccessGrantedNotification(0);
$accessRejectedNewRequest->setRejected(0);
$accessRejectedNewRequest->setHidden(1);
$accessRejectedNewRequest->setRejected(false);
$accessRejectedNewRequest->setHidden(true);
$accessRejectedNewRequest->setStartTime(0);
$accessRejectedNewRequest->setEndTime(0);
$accessRejectedNewRequest->setInformUser(0);
$accessRejectedNewRequest->setInformUser(false);
$this->accessRepository->update($accessRejectedNewRequest);
$documents[] = $accessRejectedNewRequest;
}
Expand Down

0 comments on commit 53482b9

Please sign in to comment.