From 91e2ea03b2d6f12aa08e1d12eb85b5af9f462250 Mon Sep 17 00:00:00 2001
From: Philipp Halle
Date: Thu, 15 Feb 2024 15:51:44 +0100
Subject: [PATCH] [TASK] Add TODOs for later changes on error handlig
---
Classes/Controller/ProfileController.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Classes/Controller/ProfileController.php b/Classes/Controller/ProfileController.php
index 4cbfabb..31ea71c 100644
--- a/Classes/Controller/ProfileController.php
+++ b/Classes/Controller/ProfileController.php
@@ -92,6 +92,7 @@ public function showProfileSwitchAction(): ResponseInterface
{
$profileUids = $this->context->getPropertyFromAspect('frontend.profile', 'allProfileUids', []);
+ // TODO: Don't return empty response if no profiles are assigned to user
if (empty($profileUids)) {
return $this->htmlResponse();
}
@@ -135,6 +136,8 @@ public function showProfileEditingFormAction(Profile $profile = null): ResponseI
}
$profileUids = $this->context->getPropertyFromAspect('frontend.profile', 'allProfileUids', []);
+
+ // TODO: To die() is no good way out here, talk to your trusted TYPO3 developer first
if ($profile === null || !in_array($profile->getUid(), $profileUids)) {
GeneralUtility::makeInstance(ErrorController::class)->accessDeniedAction(
$this->request,