From bc7e158eaf953f13c857178bf4e13f5620dd1211 Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Thu, 31 Oct 2024 08:29:24 +0100 Subject: [PATCH] [BUGFIX] Add better restriction to show view for preselected records If singleRecords is filled, the displayMode is set to single and no override is allowed, the record is always taken from the singleRecords field. Resolves: #578 --- Classes/Controller/AddressController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/AddressController.php b/Classes/Controller/AddressController.php index 86eb73a3..d448fe40 100755 --- a/Classes/Controller/AddressController.php +++ b/Classes/Controller/AddressController.php @@ -49,7 +49,9 @@ public function initializeAction(): void public function showAction(?Address $address = null) { - if (is_a($address, Address::class) && ($this->settings['detail']['checkPidOfAddressRecord'] ?? false)) { + if ((int)($this->settings['singleRecords'] ?? 0) && !($this->settings['allowOverride'] ?? false) && ($this->settings['displayMode'] ?? '' === 'single')) { + $address = $this->addressRepository->findByUid($this->settings['singleRecords']); + } elseif (is_a($address, Address::class) && ($this->settings['detail']['checkPidOfAddressRecord'] ?? false)) { $address = $this->checkPidOfAddressRecord($address); }