From 5c39e856a35275bd938e8dab953010897ee20b61 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Wed, 29 Apr 2026 21:34:47 +0200 Subject: [PATCH] fix: pass enabledAccessTypes from ThesisEditController to edit view --- TODO.md | 4 ++++ app/src/Controllers/ThesisEditController.php | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index e8cf15c..d8f8465 100644 --- a/TODO.md +++ b/TODO.md @@ -9,6 +9,10 @@ - [x] Update action redirects to point to new pages - [x] Update admin nav header (merged 3 items → 2) +## Bug fixes + +- [x] Fix `$enabledAccessTypes` undefined / `array_map()` TypeError on edit page — controller was fetching `getAccessTypes()` instead of `getEnabledFormAccessTypes()` and returning it under the wrong key + ## CSS refactor - [x] Move semantic HTML element baseline styles into common.css diff --git a/app/src/Controllers/ThesisEditController.php b/app/src/Controllers/ThesisEditController.php index 929befa..07f2071 100644 --- a/app/src/Controllers/ThesisEditController.php +++ b/app/src/Controllers/ThesisEditController.php @@ -95,8 +95,8 @@ class ThesisEditController $finalityTypes = $this->db->getAllFinalityTypes(); $languages = $this->db->getAllLanguages(); $formatTypes = $this->db->getAllFormatTypes(); - $licenseTypes = $this->db->getAllLicenseTypes(); - $accessTypes = $this->db->getAccessTypes(); + $licenseTypes = $this->db->getAllLicenseTypes(); + $enabledAccessTypes = $this->db->getEnabledFormAccessTypes(); $rawRow = $this->db->getThesisRawFields($thesisId); $currentLicenseId = $rawRow['license_id'] ?? null; @@ -120,7 +120,7 @@ class ThesisEditController 'languages' => $languages, 'formatTypes' => $formatTypes, 'licenseTypes' => $licenseTypes, - 'accessTypes' => $accessTypes, + 'enabledAccessTypes' => $enabledAccessTypes, 'currentLicenseId' => $currentLicenseId, 'currentAccessTypeId' => $currentAccessTypeId, 'currentContextNote' => $currentContextNote,