CRM-18984 : Can't delete an import/export mapping
authoryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 23 Jun 2016 10:18:11 +0000 (15:48 +0530)
committerNathan Brettell <nathanbrettell@gmail.com>
Wed, 28 Sep 2016 15:43:50 +0000 (16:43 +0100)
----------------------------------------
* CRM-18984: Can't delete an import/export mapping
  https://issues.civicrm.org/jira/browse/CRM-18984

Signed-off-by: Nathan Brettell <nathanbrettell@gmail.com>
CRM/Core/BAO/Mapping.php

index e3ca41e98ba69aca9c7f5c6a20417e4ef3614fd8..791a04557c783f3480139c309464f0c2ee7bb4d6 100644 (file)
@@ -74,10 +74,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     // delete from mapping_field table
     $mappingField = new CRM_Core_DAO_MappingField();
     $mappingField->mapping_id = $id;
-    $mappingField->find();
-    while ($mappingField->fetch()) {
-      $mappingField->delete();
-    }
+    $mappingField->delete();
 
     // delete from mapping table
     $mapping = new CRM_Core_DAO_Mapping();