From b39846fa08f65f59a54a45fa66d020232cac0806 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 17 Jan 2025 12:43:04 +1300 Subject: [PATCH] Smarty notice fix on tell-a-friend --- CRM/Event/Form/Registration/ThankYou.php | 13 ++++++++----- templates/CRM/Event/Form/Registration/ThankYou.tpl | 8 +++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index 3d1a8b16591b..694933d150ad 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -158,27 +158,30 @@ public function buildQuickForm() { $params['entity_table'] = 'civicrm_event'; $data = []; - $friendURL = NULL; + $extensionText = []; if (function_exists('tellafriend_civicrm_config')) { + // @todo - move this to tellafriend extension CRM_Friend_BAO_Friend::retrieve($params, $data); if (!empty($data['is_active'])) { $friendText = $data['title']; - $this->assign('friendText', $friendText); if ($this->_action & CRM_Core_Action::PREVIEW) { $friendURL = CRM_Utils_System::url('civicrm/friend', - "eid={$this->_eventId}&reset=1&action=preview&pcomponent=event" + "eid={$this->getEventID()}&reset=1&action=preview&pcomponent=event" ); } else { $friendURL = CRM_Utils_System::url('civicrm/friend', - "eid={$this->_eventId}&reset=1&pcomponent=event" + "eid={$this->getEventID()}&reset=1&pcomponent=event" ); } + $extensionText[] = '"

"'; } } - $this->assign('friendURL', $friendURL); + $this->assign('extensionText', $extensionText); $this->assign('iCal', CRM_Event_BAO_Event::getICalLinks($this->_eventId)); $this->assign('isShowICalIconsInline', TRUE); diff --git a/templates/CRM/Event/Form/Registration/ThankYou.tpl b/templates/CRM/Event/Form/Registration/ThankYou.tpl index c4251ad6fb99..951a78c4d303 100644 --- a/templates/CRM/Event/Form/Registration/ThankYou.tpl +++ b/templates/CRM/Event/Form/Registration/ThankYou.tpl @@ -22,11 +22,9 @@ {/if} {* Show link to Tell a Friend (CRM-2153) *} - {if $friendText} -

- {/if} + {foreach from='extensionText' item='text'} + {$text} + {/foreach} {* Add button for donor to create their own Personal Campaign page *} {if $pcpLink}