CRM-15271 - broken last viewed links
authorEileen McNaughton <eileen@fuzion.co.nz>
Wed, 10 Sep 2014 00:12:57 +0000 (12:12 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Mon, 20 Oct 2014 04:02:59 +0000 (17:02 +1300)
CRM/Contribute/Page/Tab.php

index c63ae358cf635297480b17a805e054fccfa4311d..17cf83a9768294b8f7632a7f5ef502e9dbb2daba 100644 (file)
@@ -254,7 +254,10 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
       $this->_action = CRM_Core_Action::ADD;
     }
     else {
-      $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+      $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, empty($this->_id));
+      if (empty($this->_contactId)) {
+        $this->_contactId = civicrm_api3('contribution', 'getvalue', array('id' => $this->_id, 'return' => 'contact_id'));
+      }
       $this->assign('contactId', $this->_contactId);
 
       // check logged in url permission