Warning Fix: call_user_func() expects parameter 1 to be a valid callback, second...
authordeepak-srivastava <deepak.srivastava.0303@gmail.com>
Fri, 13 Mar 2015 21:54:01 +0000 (21:54 +0000)
committerdeepak-srivastava <deepak.srivastava.0303@gmail.com>
Fri, 13 Mar 2015 21:54:01 +0000 (21:54 +0000)
CRM/Core/Form/RecurringEntity.php

index e976659659aa4aa8ccd8ead2ca72181a6ba52b0c..1a12dba4a492db35133e8c8a3ae354747e18be3e 100644 (file)
@@ -412,11 +412,18 @@ class CRM_Core_Form_RecurringEntity {
           if (CRM_Utils_Array::value('pre_delete_func', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]) &&
             CRM_Utils_Array::value('helper_class', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']])
           ) {
-            call_user_func(array(
-                CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['helper_class'],
-                call_user_func_array(CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['pre_delete_func'], array($params['entity_id'])),
-              )
+            $preDeleteResult = call_user_func_array(
+              CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['pre_delete_func'], 
+              array($params['entity_id'])
             );
+            if (!empty($preDeleteResult)) {
+              call_user_func(
+                array(
+                  CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['helper_class'],
+                  $preDeleteResult
+                )
+              );
+            }
           }
           //Ready to execute delete on entities if it has delete function set
           if (CRM_Utils_Array::value('delete_func', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]) &&