From 6c0dbcf3e84ff5eee0f3f128c638f40b426a3164 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Sat, 27 May 2017 03:00:11 +0530 Subject: [PATCH] CRM-20649, Fixed notice error on form rule ---------------------------------------- * CRM-20649: Notice error when creating Price set https://issues.civicrm.org/jira/browse/CRM-20649 --- CRM/Price/Form/Set.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php index 0169689aa7..6ab31472ac 100644 --- a/CRM/Price/Form/Set.php +++ b/CRM/Price/Form/Set.php @@ -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; } -- 2.25.1