fix: [attribute correlations] account for both entry points, event view and attribute index

- to select the correct field for the remote ID (rather than point at an attribute ID in the related events)
composer_fix
iglocska 2023-02-28 13:56:07 +01:00
parent 91d87b4e44
commit 68c6563dc8
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 4 additions and 3 deletions

View File

@ -32,11 +32,12 @@
foreach ($relatedData as $k => $v) {
$popover .= '<b class="black">' . h($k) . '</b>: <span class="blue">' . h($v) . '</span><br>';
}
$relevantId = !isset($relatedAttribute['attribute_id']) ? $relatedAttribute['Event']['id'] : $relatedAttribute['id'];
$link = $this->Html->link(
$relatedAttribute['Event']['id'],
$relevantId,
$withPivot ?
['controller' => 'events', 'action' => 'view', $relatedAttribute['Event']['id'], true, $event['Event']['id']] :
['controller' => 'events', 'action' => 'view', $relatedAttribute['Event']['id']],
['controller' => 'events', 'action' => 'view', $relevantId, true, $event['Event']['id']] :
['controller' => 'events', 'action' => 'view', $relevantId],
['class' => ($relatedAttribute['org_id'] == $me['org_id']) ? $linkColour : 'blue']
);
echo sprintf(