diff --git a/ext/tellafriend/tellafriend.php b/ext/tellafriend/tellafriend.php index 243ffbf2e39d920f98917c9409c5124f44578896..694b934fbfdf368e784dd8384c2e49d3a0ca5f85 100644 --- a/ext/tellafriend/tellafriend.php +++ b/ext/tellafriend/tellafriend.php @@ -54,9 +54,13 @@ function tellafriend_civicrm_tabset($tabsetName, &$tabs, $context) { 'template' => FALSE, 'count' => FALSE, 'icon' => FALSE, - 'url' => $tabsetName === 'civicrm/event/manage' ? 'civicrm/event/manage/friend' : '', + 'url' => '', 'field' => 'friend', ]; + $isFromBrowsePage = ($tabs['settings']['url'] ?? '') === 'civicrm/event/manage/settings' && empty($tabs['friend']); + if ($isFromBrowsePage) { + $default['url'] = 'civicrm/event/manage/friend'; + } $tabs['friend'] = ['title' => ts('Tell a Friend')] + $default; } }