Skip to content

Commit

Permalink
[BUGFIX] Add better restriction to show view for preselected records
Browse files Browse the repository at this point in the history
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
  • Loading branch information
georgringer committed Oct 31, 2024
1 parent 1606b42 commit bc7e158
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/Controller/AddressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit bc7e158

Please sign in to comment.