core/issues/74 - 'Price Set Details for Event Participants' gives DB error if the...
authoryashodha <yashodha@cividesk.com>
Tue, 24 Apr 2018 06:10:10 +0000 (11:40 +0530)
committeryashodha <yashodha@cividesk.com>
Tue, 24 Apr 2018 06:10:10 +0000 (11:40 +0530)
CRM/Contact/Form/Search/Custom/PriceSet.php

index 327ddc88b9e6c2754a572639cdb755b628329b3d..86d6631495e4ee9198ebe9c9044cea5c49e72a45 100644 (file)
@@ -146,12 +146,14 @@ ORDER BY c.id, l.price_field_value_id;
 
     foreach (array_keys($rows) as $participantID) {
       $values = implode(',', $rows[$participantID]);
-      $sql = "
+      if ($values) {
+        $sql = "
 UPDATE {$this->_tableName}
 SET $values
 WHERE participant_id = $participantID;
 ";
-      CRM_Core_DAO::executeQuery($sql);
+        CRM_Core_DAO::executeQuery($sql);
+      }
     }
   }