From cacc57d70c7324d0a92e35021bb419b71a5e83f8 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 23 Jun 2014 19:59:06 -0700 Subject: [PATCH] CRM-14856 - Fix regression with Drupal-Profile integration --- CRM/Profile/Form.php | 16 ++++++---------- CRM/Profile/Form/Edit.php | 7 +++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index f223130a94..7bae7ccda6 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -245,10 +245,6 @@ class CRM_Profile_Form extends CRM_Core_Form { $this->set('gid', $this->_gid); } - if (!$this->_gid) { - CRM_Core_Error::fatal(ts('The required parameter "gid" is missing or malformed.')); - } - $this->_activityId = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE, 0, 'GET'); if (is_numeric($this->_activityId)) { $latestRevisionId = CRM_Activity_BAO_Activity::getLatestActivityId($this->_activityId); @@ -268,14 +264,14 @@ class CRM_Profile_Form extends CRM_Core_Form { $this->_ufGroup = (array) $dao; } $dao->free(); - } - $this->assign('ufGroupName', $this->_ufGroup['name']); - if (!CRM_Utils_Array::value('is_active', $this->_ufGroup)) { - CRM_Core_Error::fatal(ts('The requested profile (gid=%1) is inactive or does not exist.', array( - 1 => $this->_gid, - ))); + if (!CRM_Utils_Array::value('is_active', $this->_ufGroup)) { + CRM_Core_Error::fatal(ts('The requested profile (gid=%1) is inactive or does not exist.', array( + 1 => $this->_gid, + ))); + } } + $this->assign('ufGroupName', $this->_ufGroup['name']); $gids = empty($this->_profileIds) ? $this->_gid : $this->_profileIds; diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index da71bedbc5..216bf8fc72 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -113,6 +113,13 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form { parent::preProcess(); + // make sure the gid is set and valid + if (!$this->_gid) { + CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) is disabled, OR there is no Profile with that ID, OR a valid \'gid=\' integer value is missing from the URL. Contact the site administrator if you need assistance.', + array(1 => $this->_gid) + )); + } + // and also the profile is of type 'Profile' $query = " SELECT module -- 2.25.1