CRM-19529 - PHP7-Upcoming/Recent Case Activities results into 'Network Error'
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 18 Oct 2016 09:46:11 +0000 (15:16 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 18 Oct 2016 09:46:11 +0000 (15:16 +0530)
CRM/Case/Page/CaseDetails.php
CRM/Case/Page/Tab.php

index ea2e349f68af1cd655bf369403f255a1e3ab9f26..06c42ebc9e2709351e31d0556bc3728aec11eb8a 100644 (file)
@@ -50,7 +50,7 @@ class CRM_Case_Page_CaseDetails extends CRM_Core_Page {
 
     $caseId = CRM_Utils_Request::retrieve('caseId', 'Positive', $this);
 
-    CRM_Case_Page_Tab::setContext();
+    CRM_Case_Page_Tab::setContext($this);
 
     $this->assign('caseID', $caseId);
     $this->assign('contactID', $this->_contactId);
index 9ad7e348a92a27e5833aa56f2e7f447fc8042748..97d819e12aa43f8346b21ed67a68f14192938349 100644 (file)
@@ -191,7 +191,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
 
     $this->assign('action', $this->_action);
 
-    $this->setContext();
+    self::setContext($this);
 
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->view();
@@ -241,11 +241,15 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
     return self::$_links;
   }
 
-  public function setContext() {
-    $context = $this->get('context');
+  /**
+   * @param CRM_Core_Form $form
+   */
+  public static function setContext(&$form) {
+    $context = $form->get('context');
+    CRM_Core_Error::Debug("context", $context);
     $url = NULL;
 
-    $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;
@@ -253,9 +257,9 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
 
     switch ($context) {
       case 'activity':
-        if ($this->_contactId) {
+        if ($form->_contactId) {
           $url = CRM_Utils_System::url('civicrm/contact/view',
-            "reset=1&force=1&cid={$this->_contactId}&selectedChild=activity"
+            "reset=1&force=1&cid={$form->_contactId}&selectedChild=activity"
           );
         }
         break;
@@ -281,12 +285,12 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
         break;
 
       case 'fulltext':
-        $action = CRM_Utils_Request::retrieve('action', 'String', $this);
+        $action = CRM_Utils_Request::retrieve('action', 'String', $form);
         $urlParams = 'force=1';
         $urlString = 'civicrm/contact/search/custom';
         if ($action == CRM_Core_Action::RENEW) {
-          if ($this->_contactId) {
-            $urlParams .= '&cid=' . $this->_contactId;
+          if ($form->_contactId) {
+            $urlParams .= '&cid=' . $form->_contactId;
           }
           $urlParams .= '&context=fulltext&action=view';
           $urlString = 'civicrm/contact/view/case';
@@ -298,9 +302,9 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
         break;
 
       default:
-        if ($this->_contactId) {
+        if ($form->_contactId) {
           $url = CRM_Utils_System::url('civicrm/contact/view',
-            "reset=1&force=1&cid={$this->_contactId}&selectedChild=case"
+            "reset=1&force=1&cid={$form->_contactId}&selectedChild=case"
           );
         }
         break;