From: Donald A. Lobo Date: Mon, 20 May 2013 17:57:32 +0000 (-0700) Subject: CRM-12667 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f60608798b82a0faa33f0907516eba3c68c256ef;p=civicrm-core.git CRM-12667 ---------------------------------------- * CRM-12667: Tell a Friend causes error: "You do not have permission to access this page" http://issues.civicrm.org/jira/browse/CRM-12667 --- diff --git a/CRM/Friend/Form/Event.php b/CRM/Friend/Form/Event.php index f815834fa9..9eaa8a9537 100644 --- a/CRM/Friend/Form/Event.php +++ b/CRM/Friend/Form/Event.php @@ -64,7 +64,13 @@ class CRM_Friend_Form_Event extends CRM_Event_Form_ManageEvent { $defaults['entity_table'] = 'civicrm_event'; $defaults['entity_id'] = $this->_id; CRM_Friend_BAO_Friend::getValues($defaults); - $this->_friendId = CRM_Utils_Array::value('id', $defaults); + if (CRM_Utils_Array::value('id', $defaults)) { + $defaults['tf_id'] = CRM_Utils_Array::value('id', $defaults); + $this->_friendId = $defaults['tf_id']; + // lets unset the 'id' since it conflict with eventID (or contribID) + // CRM-12667 + unset($defaults['id']); + } $defaults['tf_title'] = CRM_Utils_Array::value('title', $defaults); $defaults['tf_is_active'] = CRM_Utils_Array::value('is_active', $defaults); $defaults['tf_thankyou_title'] = CRM_Utils_Array::value('thankyou_title', $defaults);