Issue Bug Closed

#90220Scheduler results in exception when used with sqlite

Daniel Siepmann 01/27/20, 17:47 updated 04/01/20, 21:14

Description

Opening the scheduler module in TYPO3 Backend results in the following error:

> (1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
>
> PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/daniels/Projects/own/website-typo3/project/private/typo3/sysext/scheduler/Classes/Scheduler.php line 130
>

The database entry is:

***************************[ 1. row ]***************************
uid                    | 3
crdate                 | 1580142884
disable                | 0
deleted                | 0
description            | 
nextexecution          | 1580146200
lastexecution_time     | 1580143156
lastexecution_failure  | 
lastexecution_context  | BE
serialized_task_object | O:45:"TYPO3\CMS\Reports\Task\SystemStatusUpdateTask":11:{s:20:"^@*^@notificationEmail";s:25:"***@example.com";s:18:"^@*^@notificationAll";b:0;s:12:"^@*^@schedul er";N;s:10:"^@*^@taskUid";i:3;s:11:"^@*^@disabled";b:0;s:19:"^@*^@runOnNextCronJob";b:0;s:12:"^@*^@execution";O:29:"TYPO3\CMS\Scheduler\Execution":6:{s:8:"^@*^@start";i:1580142861;s:6:"^@*^@end"; s:0:"";s:11:"^@*^@interval";i:0;s:11:"^@*^@multiple";s:1:"0";s:10:"^@*^@cronCmd";s:10:"30 * * * *";s:23:"^@*^@isNewSingleExecution";b:0;}s:16:"^@*^@executionTime";i:1580146200;s:14:"^@*^@descript ion";s:0:"";s:12:"^@*^@taskGroup";i:1;s:9:"^@*^@logger";N;}
serialized_executions  | 
task_group             | 1

And structure:

+-----+------------------------+-------------------+---------+------------+----+
| cid | name                   | type              | notnull | dflt_value | pk |
+-----+------------------------+-------------------+---------+------------+----+
| 0   | uid                    | INTEGER           | 1       | <null>     | 1  |
| 1   | crdate                 | INTEGER UNSIGNED  | 1       | 0          | 0  |
| 2   | disable                | SMALLINT UNSIGNED | 1       | 0          | 0  |
| 3   | deleted                | SMALLINT UNSIGNED | 1       | 0          | 0  |
| 4   | description            | CLOB              | 0       | NULL       | 0  |
| 5   | nextexecution          | INTEGER UNSIGNED  | 1       | 0          | 0  |
| 6   | lastexecution_time     | INTEGER UNSIGNED  | 1       | 0          | 0  |
| 7   | lastexecution_failure  | CLOB              | 0       | NULL       | 0  |
| 8   | lastexecution_context  | VARCHAR(3)        | 1       | ''         | 0  |
| 9   | serialized_task_object | BLOB              | 0       | NULL       | 0  |
| 10  | serialized_executions  | BLOB              | 0       | NULL       | 0  |
| 11  | task_group             | INTEGER UNSIGNED  | 1       | 0          | 0  |
+-----+------------------------+-------------------+---------+------------+----+

> at count(false)
> in /home/daniels/Projects/own/website-typo3/project/private/typo3/sysext/scheduler/Classes/Scheduler.php line 130
>
> }
> }
> }
> $executionCount = count($executions);
> if (count($serialized_executions) !== $executionCount) {
> // if (is_array($serialized_executions) && count($serialized_executions) !== $executionCount) {
> if ($executionCount === 0) {
> $value = ‘’;
> } else {
>

Reviews 1