Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.9
-
Fix Version/s: 4.6
-
Component/s: None
-
Labels:None
-
Documentation Required?:Developer Doc
Description
At the moment the preProcess hook is an option but if CiviCRM preProcess throws a fatal then the preProcess hook is never called. The problem here is that disabled contribution pages result in
"Sorry but we are not able to provide this at the moment.
The page you requested is currently unavailable.
Return to home page."
However, we can't 'get to it' with a hook to do something sensible instead. (redirect according to business rules so as not to lose the donor)
My thinking is that we could replace
// check if form is active
if (empty($this->_values['is_active']))
with
throw new CRM_Core_Exception(ts('The page you requested is currently unavailable.');
and the calling code could look like
function buildForm() {
$this->_formBuilt = TRUE;
try
catch (CRM_Core_Exception $e)
{ //call hook in case it redirects (or a new hook) CRM_Utils_Hook::preProcess(get_class($this), $this); CRM_Core_Fatal($e->getMessage); }CRM_Utils_Hook::preProcess(get_class($this), $this);