0

Drupal 7.90 CiviCRM 5.51.1 We use line items & webform civi integration for all contributions.

We are having random instances where a contribution is made, it is processed in iATS, the contribution table has the information, BUT there is no record in the civicrm_line_item table, and the webform submission also do not show any record. Most of the time it works but several times a week we get these partially completed records.

I have tried several test contributions and have not been able to duplicate the problem. With every (successful or partial contributions) we get a Fatal Error and the Depreciated Function message in the logs. I am hoping that if I take care of the Fatal Error, the random lack of recording to SQL tables goes away.

$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler ) [code] => -1 [message] => DB Error: unknown error [mode] => 16 [debug_info] => [nativecode=0 **] [type] => DB_Error [user_info] => [nativecode=0 **] [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info=" [nativecode=0 **]"] )

Deprecated function ::civicrm_api3_contribution_transact, use The contibution.transact api is unsupported & known to have issues. Please see the section at the bottom of https://docs.civicrm.org/dev/en/latest/financial/orderAPI/ for getting off it. Array ( [civi.tag] => deprecated )

$backTrace = #0 /home/radiusint/secure/sites/all/modules/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 .../sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 .../sites/all/modules/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), " [nativecode=0 **]")
#3 .../sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), " [nativecode=0 **]")
#4 .../sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), " [nativecode=0 **]", "DB_Error", TRUE)
#5 .../sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 .../sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, " [nativecode=0 **]", "0 ** ")
#7 .../sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
#8 .../sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("")
#9 .../sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query("")
#10 .../sites/all/modules/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("")
#11 .../sites/all/modules/civicrm/CRM/Core/DAO.php(472): DB_DataObject->query("")
#12 .../sites/all/modules/civicrm/CRM/Core/DAO.php(1709): CRM_Core_DAO->query("", TRUE)
#13 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/CivirulesConditions/ContributionRecur/PaymentProcessor.php(76): CRM_Core_DAO::singleValueQuery("", (Array:1))
#14 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Engine.php(299): CRM_CivirulesConditions_ContributionRecur_PaymentProcessor->isConditionValid(Object(CRM_Civirules_TriggerData_Edit))
#15 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Engine.php(252): CRM_Civirules_Engine::checkCondition((Array:5), Object(CRM_Civirules_TriggerData_Edit))
#16 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Engine.php(32): CRM_Civirules_Engine::areConditionsValid(Object(CRM_Civirules_TriggerData_Edit))
#17 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Trigger/Post.php(123): CRM_Civirules_Engine::triggerRule(Object(CRM_Civirules_Trigger_Post), Object(CRM_Civirules_TriggerData_Edit))
#18 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Trigger/Post.php(107): CRM_Civirules_Trigger_Post->triggerTrigger("create", "Email", 17442, Object(CRM_Core_DAO_Email), "62d81355930c7")
#19 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/civirules.php(485): CRM_Civirules_Trigger_Post::post("create", "Email", 17442, Object(CRM_Core_DAO_Email), "62d81355930c7")
#20 internal function: civirules_call_post_trigger("create", "Email", 17442, Object(CRM_Core_DAO_Email), "62d81355930c7")
#21 .../sites/all/modules/civicrm/Civi/Core/Transaction/Frame.php(198): call_user_func_array("civirules_call_post_trigger", (Array:5))
#22 .../sites/all/modules/civicrm/Civi/Core/Transaction/Frame.php(148): Civi\Core\Transaction\Frame->invokeCallbacks(2)
#23 .../sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php(103): Civi\Core\Transaction\Frame->finish()
#24 .../sites/all/modules/civicrm/CRM/Core/Transaction.php(126): Civi\Core\Transaction\Manager->dec()
#25 .../sites/all/modules/civicrm/CRM/Core/Transaction.php(113): CRM_Core_Transaction->commit()
#26 .../sites/all/modules/civicrm/Civi/API/Subscriber/TransactionSubscriber.php(155): CRM_Core_Transaction->__destruct()
#27 .../sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\API\Subscriber\TransactionSubscriber->onApiRespond(Object(Civi\API\Event\RespondEvent), "civi.api.respond", Object(Civi\Core\CiviEventDispatcher))
#28 .../sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:5), "civi.api.respond", Object(Civi\API\Event\RespondEvent))
#29 .../sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(209): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("civi.api.respond", Object(Civi\API\Event\RespondEvent))
#30 .../sites/all/modules/civicrm/Civi/API/Kernel.php(258): Civi\Core\CiviEventDispatcher->dispatch("civi.api.respond", Object(Civi\API\Event\RespondEvent))
#31 .../sites/all/modules/civicrm/Civi/API/Kernel.php(151): Civi\API\Kernel->respond(Object(Civi\API\Provider\MagicFunctionProvider), (Array:8), (Array:5))
#32 .../sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#33 .../sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("email", "create", (Array:5))
#34 .../sites/all/modules/webform_civicrm/includes/utils.inc(1666): civicrm_api("email", "create", (Array:5))
#35 .../sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc(1802): wf_civicrm_api("email", "create", (Array:5))
#36 .../sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc(96): wf_crm_webform_postprocess->createBillingContact()
#37 .../sites/all/modules/webform_civicrm/webform_civicrm.module(698): wf_crm_webform_postprocess->validate((Array:33), (Array:26))
#38 .../includes/form.inc(1531): wf_crm_validate((Array:33), (Array:26))
#39 .../includes/form.inc(1471): form_execute_handlers("validate", (Array:33), (Array:26))
#40 .../includes/form.inc(1193): _form_validate((Array:33), (Array:26), "webform_client_form_21")
#41 .../includes/form.inc(892): drupal_validate_form("webform_client_form_21", (Array:33), (Array:26))
#42 .../includes/form.inc(386): drupal_process_form("webform_client_form_21", (Array:33), (Array:26))
#43 .../includes/form.inc(131): drupal_build_form("webform_client_form_21", (Array:26))
#44 .../sites/all/modules/webform/webform.module(2085): drupal_get_form("webform_client_form_21", Object(stdClass), FALSE, FALSE)
#45 .../includes/module.inc(965): webform_node_view(Object(stdClass), "full", "en")
#46 .../modules/node/node.module(1441): module_invoke_all("node_view", Object(stdClass), "full", "en")
#47 .../modules/node/node.module(1336): node_build_content(Object(stdClass), "full", "en")
#48 .../modules/node/node.module(2669): node_view(Object(stdClass), "full", "en")
#49 .../modules/node/node.module(1466): node_view_multiple((Array:1), "full")
#50 .../modules/node/node.module(2761): node_show(Object(stdClass))
#51 .../includes/menu.inc(527): node_page_view(Object(stdClass))
#52 .../index.php(21): menu_execute_active_handler()
#53 {main}

2 Answers 2

1

/extensions/org.civicoop.civirules-old/civirules.php

Perhaps it is time to change this to "new" or "the most recent" ? Jokes aside, I'd start from checking civirules extension, looking particularly for ::civicrm_api3_contribution_transact function. Perhaps "webform_civicrm" is worth checking as well.

4
  • Yes the "old" might be the problem here if that's an old version or you have two different copies of the extension. Also in the stack trace it seems the query it is trying to run is an empty query "", suggesting that the trigger entity in your civirule is not correct.
    – Demerit
    Jul 21, 2022 at 14:30
  • The civirules_old was my attempt to downgrade the extension. I could not figure out how to do that so I renamed the folder for CiviRules 2.43 to that. Then I uploaded the 2.40 zip file and extracted it. That is what the above logs files were from. However, my problem started when I upgraded from Rules 2.40 to 2.41. Each upgrade since has not fixed it.
    – Iowa Boy
    Jul 21, 2022 at 23:37
  • So today, I uninstalled Rules extension and I made sure that all the files in the extension folder were removed as well. Then I reinstalled the extension with 2.43 and it is working. I still get the Deprecated function ::civicrm_api3_contribution_transact, message. But the Fatal Error went away and the Rule is functioning properly again
    – Iowa Boy
    Jul 21, 2022 at 23:40
  • @IowaBoy have you tried to update drupal side of things ( webform_civicrm )? normally civicrm reports deprecations if there is a deprecated code somewhere. Assuming your civicrm has the latest version, let's think where else would the old code be?
    – yurg
    Jul 22, 2022 at 10:37
1

The problem seemed to be something was corrupted when updating the CiviRules extension when going from 2.40 to 2.41. The next updates (2.42 & 2.43) still did not correct the corruption.

I Disabled the CiviRules extension in Civi. Then I Uninstalled it. I checked the file system to be sure all the folders related to CiviRules were removed Cleared the cache Back in Civi extensions, I Installed CiviRules

I only had 2 Rules that I cared about so I rebuilt them from scratch in the GUI. You might want to download the SQL tables and restore them to get your rules back after the reinstall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.