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}

Issue fork cleantalk-3401908

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

blainelang created an issue. See original summary.

znaeff’s picture

StatusFileSize
new42.68 KB

Hello blainelang,

Please enable the "Collect debug data" option and send us the log when useful data appears there.

agoradesign’s picture

What 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?

agoradesign’s picture

I'll post the "cron_data" part (because this should be the concerning part) and leave out the sent key:

    "cron_data": {
        "cleantalk_cron": {
            "sfw_update": {
                "handler": "\\Drupal\\cleantalk\\CleantalkFuncs::apbct_sfw_update",
                "next_call": 1699951893,
                "period": 86400,
                "params": []
            },
            "sfw_send_logs": {
                "handler": "\\Drupal\\cleantalk\\CleantalkFuncs::apbct_sfw_send_logs",
                "next_call": 1699955433,
                "period": 3600,
                "params": []
            },
            "sfw_ac__clear_table": {
                "handler": "\\Drupal\\cleantalk\\CleantalkFuncs::apbct_sfw_ac__clear_table",
                "next_call": 1699955433,
                "period": 3600,
                "params": []
            },
            "sfw_update_checker": {
                "handler": "\\Cleantalk\\Common\\Firewall\\FirewallUpdater::apbctSfwUpdateChecker",
                "next_call": 1700124146,
                "period": 15,
                "params": [
                    "***APIKEY***"
                ]
            }
        },
        "cleantalk_cron_last_start": 1700124089
    },

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

znaeff’s picture

About API key, our fault, we will review and fix it. About the issue, we will contact you within 5 business days.

maskedjellybean’s picture

I'm seeing this as well.

chetan 11 made their first commit to this issue’s fork.

chetan 11’s picture

Status: Active » Needs review
maskedjellybean’s picture

Thank you @chetan 11, this seems to resolve the issue for me.

pheski’s picture

I'm looking forward to a version that fixes this error. I'm using CleanTalk 9.3.0 on Drupal 10.1.6.

agoradesign’s picture

haven't tried it, but checked the changes. That will fix it for sure, thanks!

cgoffin’s picture

I created a patch from the MR to be used with composer.

sah62’s picture

The patch in #13 works for me.

znaeff’s picture

Status: Needs review » Reviewed & tested by the community
omd’s picture

Just 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?

znaeff’s picture

Hello @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?

bramdriesen’s picture

I 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)

glomberg made their first commit to this issue’s fork.

glomberg’s picture

Status: Reviewed & tested by the community » Fixed

We 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!

Status: Fixed » Closed (fixed)

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