Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: sah62 on January 02, 2020, 09:04:48 PM

Title: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: sah62 on January 02, 2020, 09:04:48 PM
I'm seeing multiple errors like this when the "send birthday emails" scheduled task runs automatically after my upgrade to 2.0.17. I'm running PHP 7.2:

8: Undefined index: character_set
File: /var/www/mysite/web/forum/Sources/Subs-Post.php
Line: 1219

8: Undefined index: utf8
File: /var/www/mysite/web/forum/Sources/Subs-Post.php
Line: 1264

8: Undefined index: utf8
File: /var/www/mysite/web/forum/Sources/Subs-Post.php
Line: 1262

8: Undefined index: character_set
Apply Filter: Only show the errors from this file
File: /var/www/mysite/web/forum/Sources/Subs-Post.php
Line: 1219

8: Undefined index: server
File: /var/www/mysite/web/forum/Sources/Subs-Post.php
Line: 627

Is there something I can look at to fix whatever is going on?
Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: Illori on January 03, 2020, 05:01:09 AM
this is a known long standing bug that we dont have a solution for.
Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: user2020 on January 03, 2020, 04:28:37 PM
This is also happening on mods like RSS Feed Poster.  :-[
Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: Shambles on January 03, 2020, 05:48:42 PM
Quote from: Illori on January 03, 2020, 05:01:09 AM
this is a known long standing bug that we dont have a solution for.
Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: bulatus on January 04, 2020, 12:50:18 AM
After the update, there were really errors.
8: Undefined index: character_set
8: Undefined index: server
8: Undefined index: utf8
Task Manager logs (.../public_html/Sources/Subs-Post.in PHP): notifications of endorsements; Daily maintenance; Sending greetings and of course mods such as RSS poster feed.

Quotethis is a known long standing bug that we dont have a solution for.
:D
Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: aegersz on June 21, 2021, 10:41:43 PM
I have this bug too on my 2.0.18 system.

It doesn't seem to be stopping the sending of birthday emails so I am not worried.

Quotethis is a known long standing bug that we don't have a solution for

I'm glad that it's not just me that can't fix certain bugs  :)

Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: Sir Osis of Liver on June 21, 2021, 10:55:00 PM
The errors are harmless, but if you like fudge, you can do this -

Subs-Post.php



/// Fudge to remove undefined errors from scheduled tasks
if (!isset($context['server']))
$context['server'] = null;

if (!isset($context['character_set']))
$context['character_set'] = null;

etc.



There was another fix posted by one of the devs, but can't find it. >:(
Title: Re: 2.0.17 Undefined index Errors When Running Scheduled Task
Post by: aegersz on June 22, 2021, 12:08:10 AM
Thanks but I might just live with it anyway plus I can't test the fix easily -- when I run the scheduled task manually it works without errors.