Skip to content

Prevent TypeError if $rewriteArray is NULL

brienne requested to merge brienne/sktokens:main into main
TypeError: Civi\Sktokens\Utils::getRewrittenToken(): Argument #2 ($columns) must be of type array, null given, called in /code/sites/all/civicrm/extensions/sktokens/sktokens.php on line 67 in Civi\Sktokens\Utils::getRewrittenToken() (line 23 of /code/sites/all/civicrm/extensions/sktokens/Civi/Sktokens/Utils.php)

#0 /code/sites/all/civicrm/extensions/sktokens/sktokens.php(67): Civi\Sktokens\Utils::getRewrittenToken('Tax Statement', NULL)
#1 /code/vendor/symfony/event-dispatcher/EventDispatcher.php(251): sktokens_evaluate_tokens(Object(Civi\Token\Event\TokenValueEvent), 'civi.token.eval', Object(Civi\Core\UnoptimizedEventDispatcher))
#2 /code/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'civi.token.eval', Object(Civi\Token\Event\TokenValueEvent))
#3 /code/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(263): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Token\Event\TokenValueEvent), 'civi.token.eval')
#4 /code/vendor/civicrm/civicrm-core/Civi/Token/TokenProcessor.php(354): Civi\Core\CiviEventDispatcher->dispatch('civi.token.eval', Object(Civi\Token\Event\TokenValueEvent))
#5 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/Listener/DefaultComposer.php(79): Civi\Token\TokenProcessor->evaluate()
#6 [internal function]: Civi\FlexMailer\Listener\DefaultComposer->onCompose(Object(Civi\FlexMailer\Event\ComposeBatchEvent), 'civi.flexmailer...', Object(Civi\Core\UnoptimizedEventDispatcher))
#7 /code/vendor/civicrm/civicrm-core/Civi/Core/Event/ServiceListener.php(53): call_user_func_array(Array, Array)
#8 /code/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\Event\ServiceListener->__invoke(Object(Civi\FlexMailer\Event\ComposeBatchEvent), 'civi.flexmailer...', Object(Civi\Core\UnoptimizedEventDispatcher))
#9 /code/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'civi.flexmailer...', Object(Civi\FlexMailer\Event\ComposeBatchEvent))
#10 /code/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(263): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\FlexMailer\Event\ComposeBatchEvent), 'civi.flexmailer...')
#11 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/FlexMailer.php(212): Civi\Core\CiviEventDispatcher->dispatch('civi.flexmailer...', Object(Civi\FlexMailer\Event\ComposeBatchEvent))
#12 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/FlexMailer.php(158): Civi\FlexMailer\FlexMailer->fireComposeBatch(Array)
#13 [internal function]: Civi\FlexMailer\FlexMailer->Civi\FlexMailer\{closure}(Array)
#14 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/Event/WalkBatchesEvent.php(55): call_user_func(Object(Closure), Array)
#15 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/Listener/DefaultBatcher.php(71): Civi\FlexMailer\Event\WalkBatchesEvent->visit(Array)
#16 [internal function]: Civi\FlexMailer\Listener\DefaultBatcher->onWalk(Object(Civi\FlexMailer\Event\WalkBatchesEvent), 'civi.flexmailer...', Object(Civi\Core\UnoptimizedEventDispatcher))
#17 /code/vendor/civicrm/civicrm-core/Civi/Core/Event/ServiceListener.php(53): call_user_func_array(Array, Array)
#18 /code/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\Event\ServiceListener->__invoke(Object(Civi\FlexMailer\Event\WalkBatchesEvent), 'civi.flexmailer...', Object(Civi\Core\UnoptimizedEventDispatcher))
#19 /code/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'civi.flexmailer...', Object(Civi\FlexMailer\Event\WalkBatchesEvent))
#20 /code/vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php(263): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\FlexMailer\Event\WalkBatchesEvent), 'civi.flexmailer...')
#21 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/FlexMailer.php(196): Civi\Core\CiviEventDispatcher->dispatch('civi.flexmailer...', Object(Civi\FlexMailer\Event\WalkBatchesEvent))
#22 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/FlexMailer.php(161): Civi\FlexMailer\FlexMailer->fireWalkBatches(Object(Closure))
#23 /code/vendor/civicrm/civicrm-core/ext/flexmailer/src/FlexMailer.php(122): Civi\FlexMailer\FlexMailer->run()
#24 [internal function]: Civi\FlexMailer\FlexMailer::createAndRun(Object(CRM_Mailing_BAO_MailingJob), Object(CRM_Utils_Mail_FilteredPearMailer), NULL)
#25 /code/vendor/civicrm/civicrm-core/Civi/Core/Resolver.php(119): call_user_func_array(Array, Array)
#26 /code/vendor/civicrm/civicrm-core/CRM/Mailing/BAO/MailingJob.php(175): Civi\Core\Resolver->call('\\Civi\\FlexMaile...', Array)
#27 /code/vendor/civicrm/civicrm-core/CRM/Mailing/BAO/Mailing.php(2759): CRM_Mailing_BAO_MailingJob::runJobs(NULL, NULL)
#28 /code/vendor/civicrm/civicrm-core/api/v3/Job.php(333): CRM_Mailing_BAO_Mailing::processQueue()
#29 /code/vendor/civicrm/civicrm-core/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_process_mailing(Array)
#30 /code/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(158): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#31 /code/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest(Array)
#32 /code/vendor/civicrm/civicrm-core/api/api.php(22): Civi\API\Kernel->runSafe('Job', 'process_mailing', Array)
#33 /code/vendor/civicrm/civicrm-core/CRM/Core/JobManager.php(131): civicrm_api('Job', 'process_mailing', Array)
#34 /code/vendor/civicrm/civicrm-core/CRM/Core/JobManager.php(63): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#35 /code/vendor/civicrm/civicrm-core/api/v3/Job.php(117): CRM_Core_JobManager->execute(false)
#36 /code/vendor/civicrm/civicrm-core/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute(Array)
#37 /code/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(158): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#38 /code/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest(Array)
#39 /code/vendor/civicrm/civicrm-core/api/api.php(22): Civi\API\Kernel->runSafe('job', 'execute', Array)
#40 /code/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(288): civicrm_api('job', 'execute', Array)
#41 /code/vendor/civicrm/civicrm-core/CRM/Utils/REST.php(533): CRM_Utils_REST::process(Array, Array)
#42 /code/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(285): CRM_Utils_REST::ajax()
#43 /code/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#44 /code/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#45 /code/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke(Array)
#46 /code/modules/contrib/civicrm/src/Controller/CivicrmController.php(83): Drupal\civicrm\Civicrm->invoke(Array)
#47 [internal function]: Drupal\civicrm\Controller\CivicrmController->main(Array, '')
#48 /code/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#49 /code/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#50 /code/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#51 /code/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#52 /code/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#53 /code/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#54 /code/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#55 /code/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#56 /code/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#57 /code/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#58 /code/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#59 /code/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#60 /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#61 /code/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#62 /code/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#63 {main}

Merge request reports

Loading