Merge pull request #14650 from eileenmcnaughton/cust_field_create
authorcolemanw <coleman@civicrm.org>
Fri, 28 Jun 2019 01:10:57 +0000 (21:10 -0400)
committerGitHub <noreply@github.com>
Fri, 28 Jun 2019 01:10:57 +0000 (21:10 -0400)
[REF] minor code cleanup - move indexExist calculation to the only place in the code that needs it

1  2 
CRM/Core/BAO/CustomField.php

index 5daff38cef1fe05e8ded2b039e18e7ef65724d6d,a2788068ee50abf2a91d211d3b4f81c3d3dcaa7e..308cde26d358b3cab65b0b6818354e5aabd588c0
@@@ -173,13 -173,8 +173,7 @@@ class CRM_Core_BAO_CustomField extends 
          'column_name'
        );
      }
 -    $columnName = $params['column_name'];
  
-     $indexExist = FALSE;
-     //as during create if field is_searchable we had created index.
-     if (!empty($params['id'])) {
-       $indexExist = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $params['id'], 'is_searchable');
-     }
      switch (CRM_Utils_Array::value('html_type', $params)) {
        case 'Select Date':
          if (empty($params['date_format'])) {