CRM-18472 : Notice fixes
authoryashodha <yashodha.chaku@webaccessglobal.com>
Wed, 27 Apr 2016 07:55:48 +0000 (13:25 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Wed, 27 Apr 2016 07:55:48 +0000 (13:25 +0530)
----------------------------------------
* CRM-18472: Notice fixes
  https://issues.civicrm.org/jira/browse/CRM-18472

CRM/Event/Import/Form/MapField.php

index 9b8257f66752edb8c70192e5ff8ea425c499d622..a94c0be47c7b54609acfd60c99e8e576f84e67a8 100644 (file)
@@ -295,6 +295,8 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
    */
   public static function formRule($fields, $files, $self) {
     $errors = array();
+    // define so we avoid notices below
+    $errors['_qf_default'] = '';
     $fieldMessage = NULL;
     if (!array_key_exists('savedMapping', $fields)) {
       $importKeys = array();
@@ -375,6 +377,9 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
       }
     }
 
+    if (empty($errors['_qf_default'])) {
+      unset($errors['_qf_default']);
+    }
     if (!empty($errors)) {
       if (!empty($errors['saveMappingName'])) {
         $_flag = 1;