strict warning fixes CRM-14944
authorkurund <kurund@civicrm.org>
Sat, 5 Jul 2014 14:29:12 +0000 (19:59 +0530)
committerkurund <kurund@civicrm.org>
Sat, 5 Jul 2014 14:29:12 +0000 (19:59 +0530)
----------------------------------------
* CRM-14944: function should not be called statically - pledge page
  https://issues.civicrm.org/jira/browse/CRM-14944

CRM/Pledge/Page/Payment.php
CRM/Pledge/Page/Tab.php

index ac36d7e2d1619b545d6b17aec526748cc1552f60..6d5ab08dc20fcbb688869e69a07b68b32d66e4b4 100644 (file)
@@ -49,7 +49,7 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page {
 
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
 
-    CRM_Pledge_Page_Tab::setContext();
+    CRM_Pledge_Page_Tab::setContext($this);
 
     if ($this->_action & CRM_Core_Action::UPDATE) {
       $this->edit();
index ca0e360704c742b66416c9936d8441d83146830c..152e8b7caf354b5d3a1498b31bb89608de8a34a1 100644 (file)
@@ -138,7 +138,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page {
     // check if we can process credit card registration
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
 
-    $this->setContext();
+    self::setContext($this);
 
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->view();
@@ -159,10 +159,10 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page {
     return parent::run();
   }
 
-  function setContext() {
-    $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
+  function setContext(&$form) {
+    $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search');
 
-    $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
+    $qfKey = CRM_Utils_Request::retrieve('key', 'String', $form);
     //validate the qfKey
     if (!CRM_Utils_Rule::qfKey($qfKey)) {
       $qfKey = NULL;
@@ -209,8 +209,8 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page {
 
       default:
         $cid = NULL;
-        if ($this->_contactId) {
-          $cid = '&cid=' . $this->_contactId;
+        if ($form->_contactId) {
+          $cid = '&cid=' . $form->_contactId;
         }
         $url = CRM_Utils_System::url('civicrm/pledge/search',
           'force=1' . $cid