Skip to content

Commit

Permalink
IBX-7055: Blocked the possibility of deleting default dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
mikadamczyk committed Nov 27, 2023
1 parent 4163a0d commit cb91b26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
7 changes: 1 addition & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -502,19 +502,14 @@ parameters:

-
message: "#^Cannot call method getContentInfo\\(\\) on Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null\\.$#"
count: 12
count: 11
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$contentInfo of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\LocationService\\:\\:createLocation\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\ContentInfo, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\ContentInfo\\|null given\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$location of method Ibexa\\\\Contracts\\\\AdminUi\\\\Controller\\\\Controller\\:\\:redirectToLocation\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 1
path: src/bundle/Controller/LocationController.php

-
message: "#^Parameter \\#1 \\$location of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\LocationService\\:\\:getLocationChildCount\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location, Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Location\\|null given\\.$#"
count: 1
Expand Down
15 changes: 1 addition & 14 deletions src/bundle/Controller/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,26 +401,13 @@ private function handleTrashLocation(LocationTrashData $data): RedirectResponse
) {
$this->trashRelatedAsset($location->getContentInfo());
}
$trashItem = $this->trashService->trash($location);
$this->trashService->trash($location);
$this->repository->commit();
} catch (\Exception $exception) {
$this->repository->rollback();
throw $exception;
}

if ($trashItem === null) {
$this->notificationHandler->info(
$this->translator->trans(
/** @Desc("Location '%name%' was not moved to Trash.") */
'location.trash.failure',
['%name%' => $location->getContentInfo()->name],
'ibexa_location'
)
);

return $this->redirectToLocation($location);
}

$this->notificationHandler->success(
$this->translator->trans(
/** @Desc("Location '%name%' moved to Trash.") */
Expand Down

0 comments on commit cb91b26

Please sign in to comment.