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.

Issue fork simpleads-3500381

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

danchadwick created an issue. See original summary.

robbnl’s picture

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

danchadwick’s picture

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

steven snedker’s picture

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

Views Natural Sort and a host of other contrib modules have suffered this.

minnur’s picture

Status: Active » Reviewed & tested by the community
agelospanagiotakis’s picture

can we update this patch ?

minnur’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wmfinck’s picture

I have moved my issue here: https://www.drupal.org/project/drupal/issues/3558047

This must be some sort of core issue, since I do not have a need to use SimpleAds. Sorry for bothering y'all!