From: Donald A. Lobo Date: Tue, 22 Oct 2013 20:36:03 +0000 (-0700) Subject: CRM-13621 - fix error messages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d420cf02d33b672e39d2bcf11f449631625e7435;p=civicrm-core.git CRM-13621 - fix error messages ---------------------------------------- * CRM-13621: Handle invalid session errors especially for public pages in a nicer manner http://issues.civicrm.org/jira/browse/CRM-13621 --- diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 87b110ca15..ac425dc9d6 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -200,17 +200,11 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { // current contribution page id $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); if (!$this->_id) { - $pastContributionID = $session->get('pastContributionID'); - if (!$pastContributionID) { - CRM_Core_Error::fatal(ts('We can\'t load the requested web page due to an incomplete link. This can be caused by using your browser\'s Back button or by using an incomplete or invalid link.')); - } - else { - CRM_Core_Error::fatal(ts('An error occurred during form submission. This page requires form data to be submitted for processing and no form data was submitted or processed. We are sorry for any inconvience. Please click here to visit the contribution page and re-start the contribution process.', array(1 => CRM_Utils_System::url('civicrm/contribute/transact', 'reset=1&id=' . $pastContributionID)))); - } - } - else { - $session->set('pastContributionID', $this->_id); + // seems like the session is corrupted and/or we lost the id trail + // lets just bump this to a regular session error and redirect user to main page + $this->controller->invalidKeyRedirect(); } + // this was used prior to the cleverer this_>getContactID - unsure now $this->_userID = $session->get('userID'); diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 6431b4eb26..bd983966c5 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -802,7 +802,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { */ public function invalidKeyRedirect() { if ($this->_entryURL) { - CRM_Core_Session::setStatus(ts('We need a simple clear error message here')); + CRM_Core_Session::setStatus(ts('We have lost your user session and are unable to complete your form submission. We have returned you to the initial step in the form which you can complete and resubmit. If you experience continued difficulties, please contact us for assistance.')); return CRM_Utils_System::redirect($this->_entryURL); } else {