Fixed #141: only check if name exists.
authorJaap Jansma <jaap.jansma@civicoop.org>
Fri, 13 Jul 2018 09:33:10 +0000 (09:33 +0000)
committerJaap Jansma <jaap.jansma@civicoop.org>
Fri, 13 Jul 2018 09:33:10 +0000 (09:33 +0000)
CRM/Custom/Form/Group.php

index 90b6947adb6859a742b9a978d7be0b0f1e7a50da..6139759f17e013a5adec309df7b192679ffea912 100644 (file)
@@ -115,11 +115,10 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     //validate group title as well as name.
     $title = $fields['title'];
     $name = CRM_Utils_String::munge($title, '_', 64);
-    $query = 'select count(*) from civicrm_custom_group where ( name like %1 OR title like %2 ) and id != %3';
+    $query = 'select count(*) from civicrm_custom_group where ( name like %1) and id != %2';
     $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(
       1 => array($name, 'String'),
-      2 => array($title, 'String'),
-      3 => array((int) $self->_id, 'Integer'),
+      2 => array((int) $self->_id, 'Integer'),
     ));
     if ($grpCnt) {
       $errors['title'] = ts('Custom group \'%1\' already exists in Database.', array(1 => $title));