X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FPCP%2FForm%2FEvent.php;h=fee8dd964a08499a439d8b1fb846725a38e7e59d;hb=dd244018f95de3e8799532a4ebbc05490fd9f68f;hp=23ffdde5d87175ec3a30d4b030313df51b484c96;hpb=9b10578bd1e1895cf21e39ff16d3363e5419b591;p=civicrm-core.git diff --git a/CRM/PCP/Form/Event.php b/CRM/PCP/Form/Event.php index 23ffdde5d8..fee8dd964a 100644 --- a/CRM/PCP/Form/Event.php +++ b/CRM/PCP/Form/Event.php @@ -1,9 +1,9 @@ assign('pageId', $this->_id); } - if (!CRM_Utils_Array::value('id', $defaults)) { + if (empty($defaults['id'])) { $defaults['target_entity_type'] = 'event'; $defaults['is_approval_needed'] = 1; $defaults['is_tellfriend_enabled'] = 1; @@ -135,20 +135,23 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent { * * @param array $params (ref.) an assoc array of name/value pairs * + * @param $files + * @param $self + * * @return mixed true or array of errors * @access public * @static */ public static function formRule($params, $files, $self) { $errors = array(); - if (CRM_Utils_Array::value('is_active', $params)) { + if (!empty($params['is_active'])) { - if (CRM_Utils_Array::value('is_tellfriend_enabled', $params) && + if (!empty($params['is_tellfriend_enabled']) && (CRM_Utils_Array::value('tellfriend_limit', $params) <= 0) ) { $errors['tellfriend_limit'] = ts('if Tell Friend is enable, Maximum recipients limit should be greater than zero.'); } - if (!CRM_Utils_Array::value('supporter_profile_id', $params)) { + if (empty($params['supporter_profile_id'])) { $errors['supporter_profile_id'] = ts('Supporter profile is a required field.'); } else {