After upgrading to version 9.3 of this module, we are getting multiple reports of this error.
Drupal 9.5.11 and PHP 8.1.22
Warning: Undefined array key "processing" in Cleantalk\Common\Cron\Cron->checkTasks() (line 285 of /var/www/html/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Cron/Cron.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'Undefined array...', '/var/www/html/w...', 285)
#1 /var/www/html/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Cron/Cron.php(285): _drupal_error_handler(2, 'Undefined array...', '/var/www/html/w...', 285)
#2 /var/www/html/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(194): Cleantalk\Common\Cron\Cron->checkTasks()
#3 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#4 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#6 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#7 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#8 {main}| Comment | File | Size | Author |
|---|---|---|---|
| #13 | cleantalk-cron_undefined_array_key-3401908-13.patch | 917 bytes | cgoffin |
| #2 | Drupal_debug_data.png | 42.68 KB | znaeff |
Issue fork cleantalk-3401908
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
Comment #2
znaeff commentedHello blainelang,
Please enable the "Collect debug data" option and send us the log when useful data appears there.
Comment #3
agoradesign commentedWhat kind of sensitive information is inside these logs? I see that the API key is in there - anything else I should remove before posting it?
Comment #4
agoradesign commentedI'll post the "cron_data" part (because this should be the concerning part) and leave out the sent key:
no "processing" key in there - I guess this is only checked inside code, and as far as I see, it is only set to TRUE under certain circumstances, but never initialized with FALSE. But there is a check against this value, and that's why we get the warning
Comment #5
znaeff commentedAbout API key, our fault, we will review and fix it. About the issue, we will contact you within 5 business days.
Comment #6
maskedjellybeanI'm seeing this as well.
Comment #9
chetan 11 commentedComment #10
maskedjellybeanThank you @chetan 11, this seems to resolve the issue for me.
Comment #11
pheski commentedI'm looking forward to a version that fixes this error. I'm using CleanTalk 9.3.0 on Drupal 10.1.6.
Comment #12
agoradesign commentedhaven't tried it, but checked the changes. That will fix it for sure, thanks!
Comment #13
cgoffin commentedI created a patch from the MR to be used with composer.
Comment #14
sah62 commentedThe patch in #13 works for me.
Comment #15
znaeff commentedComment #16
omd commentedJust updated to 9.3.1 about 6 hours ago and still getting a "Warning: Undefined array key "processing" in Cleantalk..."type error. Was this version supposed to include the patch from #13?
Comment #17
znaeff commentedHello @OMD
Could you please send us the debug log as described above in this thread (please, do not forget to delete your API key from it) and then install the new version: https://www.drupal.org/project/cleantalk/releases/9.3.2?
Comment #18
bramdriesenI think this has been fixed without an issue: https://git.drupalcode.org/project/cleantalk/-/blob/9.1.x/lib/Cleantalk/...
Commit message: "Fix. General. Compatibility with php7.4"
Commit: https://git.drupalcode.org/project/cleantalk/-/commit/512e5364103d28479f...
Approach is a bit different, but the condition in the IF and what is being set is the same in the end. So I think we can set this as fixed (in order to credit for the people who worked on this in the past, as we've been using the patch for quite a long time as well)
Comment #20
glomberg commentedWe have merged the MR https://git.drupalcode.org/project/cleantalk/-/merge_requests/24 contained patch in #13.
Thank you @cgoffin for the solution.
Thank you all for the best conversation!