CRM-14028 - Workaround the number 0 == empty() php bug
[civicrm-core.git] / CRM / Core / BAO / Note.php
index 2a0663fdc2132d701b96b3694b18f13f4b03a207..7044ad24db4fd8ac197ff4bd819fe44609099c06 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -131,8 +131,8 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * note object. the params array could contain additional unused name/value
    * pairs
    *
-   * @param array $params  (reference ) an assoc array of name/value pairs
-   * @param array $ids  associated array with note id
+   * @param array $params  (reference) an assoc array of name/value pairs
+   * @param array $ids (deprecated) associated array with note id - preferably set $params['id']
    *
    * @return object $note CRM_Core_BAO_Note object
    * @access public
@@ -309,10 +309,12 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
       $childNote = new CRM_Core_DAO_Note();
       $childNote->id = $childId;
       $childNote->delete();
+      $childNote->free();
       $recent[] = $childId;
     }
 
     $return = $note->delete();
+    $note->free();
     if ($showStatus) {
       CRM_Core_Session::setStatus($status, ts('Deleted'), 'success');
     }