Calling Merge::key() with an array is removed in Drupal 11; cron crashes

Created on 16 January 2025, about 2 months ago

Problem/Motivation

SimpleAdsCron::runAggregation() calls merge::key() and passes an array of field names and values. This argument was deprecated in Drupal 10.2 and removed in Drupal 11. Accordingly, on Drupal 11, cron crashes, causing no cron tasks to be run by the site.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States danchadwick Boston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @danchadwick
  • πŸ‡³πŸ‡±Netherlands RobBNL

    Hi,
    I believe I am running into the same issue.
    After installing Simpleads three days ago cron stopped working.
    The errors I get are:

    TypeError: Cannot access offset of type array on array in Drupal\Core\Database\Query\Merge->key() (line 331 of ******************/core/lib/Drupal/Core/Database/Query/Merge.php)
    #0 ******************/modules/contrib/simpleads/src/SimpleAdsCron.php(96): Drupal\Core\Database\Query\Merge->key()
    #1 ******************/modules/contrib/simpleads/src/SimpleAdsCron.php(79): Drupal\simpleads\SimpleAdsCron->runAggregation()
    #2 ******************/modules/contrib/simpleads/simpleads.module(69): Drupal\simpleads\SimpleAdsCron->init()
    #3 ******************/core/lib/Drupal/Core/Cron.php(275): simpleads_cron()
    #4 ******************/core/lib/Drupal/Core/Extension/ModuleHandler.php(307): Drupal\Core\Cron->Drupal\Core\{closure}()
    #5 ******************/core/lib/Drupal/Core/Cron.php(258): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #6 ******************/core/lib/Drupal/Core/Cron.php(97): Drupal\Core\Cron->invokeCronHandlers()
    #7 ******************/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
    #8 ******************/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
    #9 ******************/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate()
    #10 ******************/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
    #11 ******************/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
    #12 ******************/vendor/symfony/http-kernel/HttpKernel.php(114): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
    #13 ******************/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(63): Symfony\Component\HttpKernel\HttpKernel->terminate()
    #14 ******************/core/lib/Drupal/Core/DrupalKernel.php(683): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
    #15 ******************/index.php(22): Drupal\Core\DrupalKernel->terminate()
    #16 {main}

    I was wondering if there is already a solution to this problem?
    Greetings,
    Rob

  • πŸ‡ΊπŸ‡ΈUnited States danchadwick Boston

    @robbnl: Apply the merge request above and test. If it fixes the problem, maybe mark this Review and Tested by the Community?

  • πŸ‡©πŸ‡°Denmark Steven Snedker

    Reviewed and tested. The patch works. Thank you @robbnl!

    Views Natural Sort πŸ› TypeError: Cannot access offset of type array on array in Drupal\Core\Database\Query\Merge->key() (line 331 of core/lib/Drupal/Core/Database/Query/Merge.php). Active and a host of other contrib modules have suffered this.

  • πŸ‡ΊπŸ‡ΈUnited States minnur San Francisco
Production build 0.71.5 2024