Skip to content
Snippets Groups Projects
Closed Error on Close Batch Call to undefined method CRM_Core_StateMachine::getTaskFormName()
  • View options
  • Error on Close Batch Call to undefined method CRM_Core_StateMachine::getTaskFormName()

  • View options
  • Closed Issue created by nicholash

    Overview

    Closing a Batch with transactions in it causes an error Error: Call to undefined method CRM_Core_StateMachine::getTaskFormName() in CRM_Contribute_Form_Search->postProcess() (line 326 of /home/account/site/vendor/civicrm/civicrm-core/CRM/Contribute/Form/Search.php).

    Reproduction steps

    Assuming there are transactions existing

    1. In Contributions -> Accounting Batches -> New Batch
    2. Create the new batch and add a couple transactions
    3. Close the batch, from either the Open Batch list using the Close action or on the individual Batch page Close Batch button

    Current behaviour

    We get an error and the batch is not closed. The following traceback is what I see in the Drupal recent messages log:

    #0 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/Form.php(646): CRM_Contribute_Form_Search->postProcess()
    #1 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Submit.php(56): CRM_Core_Form->mainProcess()
    #2 /home/account/site/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform()
    #3 /home/account/site/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle()
    #4 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle()
    #5 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/Page/Basic.php(364): CRM_Core_Controller->run()
    #6 /home/account/site/vendor/civicrm/civicrm-core/CRM/Financial/Page/BatchTransaction.php(109): CRM_Core_Page_Basic->edit()
    #7 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(338): CRM_Financial_Page_BatchTransaction->run()
    #8 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(74): CRM_Core_Invoke::runItem()
    #9 /home/account/site/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
    #10 /home/account/site/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke()
    #11 /home/account/site/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(83): Drupal\civicrm\Civicrm->invoke()
    #12 [internal function]: Drupal\civicrm\Controller\CivicrmController->main()
    #13 /home/account/site/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
    #14 /home/account/site/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #15 /home/account/site/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
    #16 /home/account/site/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    #17 /home/account/site/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #18 /home/account/site/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #19 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
    #20 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #21 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #22 /home/account/site/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
    #23 /home/account/site/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
    #24 /home/account/site/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #25 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #26 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #27 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #28 /home/account/site/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
    #29 /home/account/site/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
    #30 /home/account/site/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #31 {main}

    Expected behaviour

    It should close the batch

    Environment information

    This is happening on our prod site and the staging site as well as confirmed on another one of our staging sites.

    • CiviCRM: 5.78.4/5.78.3 (I think it was working on 5.74.5 but cannot confirm atm)
    • PHP: 8.1.30 and 8.2.24
    • CMS: Drupal 9 and 10
    Edited by nicholash

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading