CRM-20649, Fixed notice error on form rule
authorPradeep Nayak <pradpnayak@gmail.com>
Fri, 26 May 2017 21:30:11 +0000 (03:00 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Mon, 29 May 2017 08:56:27 +0000 (14:26 +0530)
----------------------------------------
* CRM-20649: Notice error when creating Price set
  https://issues.civicrm.org/jira/browse/CRM-20649

CRM/Price/Form/Set.php

index 0169689aa7eace45a18ca9947abde70d33ce1864..6ab31472ace9227aa542d339ba195dd31c72fa55 100644 (file)
@@ -97,10 +97,12 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     }
     //checks the given price set doesnot start with digit
     $title = $fields['title'];
-    // gives the ascii value
-    $asciiValue = ord($title{0});
-    if ($asciiValue >= 48 && $asciiValue <= 57) {
-      $errors['title'] = ts("Name cannot not start with a digit");
+    if ($title) {
+      // gives the ascii value
+      $asciiValue = ord($title{0});
+      if ($asciiValue >= 48 && $asciiValue <= 57) {
+        $errors['title'] = ts("Name cannot not start with a digit");
+      }
     }
     return empty($errors) ? TRUE : $errors;
   }