#106383Task serialization may fail with a type error on Start/Endtime not being INT
Description
Follow-up to #104765, quote:
I have updated to the just released TYPO3 12.4.28 which includes the bugfix for this issue.
When I try to edit a task in the scheduler module, I get the following error (using the debug preset in the development context):
TypeError TYPO3\CMS\Scheduler\Controller\SchedulerModuleController::formatTimestampForDatePicker(): Argument #1 ($timestamp) must be of type int, string given, called in /var/dvt/html/t3xxx/vendor/typo3/cms-scheduler/Classes/Controller/SchedulerModuleController.php on line 448 Quote Edit #14
The AbstractTask deserialization has no type constraint on start/end properties, and might be an empty string (or even null?)
Reviews 3
Related issues 1
History 712
-
Garvin Hicking changed due date start date Follows #104765 <span data-processor="relativetime" data-value="2025-03-18T18:14:29+00:00" > 03/18/25, 18:14 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 88645 status
NewUnder Review <span data-processor="relativetime" data-value="2025-03-18T18:21:15+00:00" > 03/18/25, 18:21 </span> -
Gerrit Code Review pushed patch set 2 for main to change 88645 <span data-processor="relativetime" data-value="2025-03-19T06:15:57+00:00" > 03/19/25, 06:15 </span>
-
Florian Seirer commented <span data-processor="relativetime" data-value="2025-03-19T07:52:32+00:00" > 03/19/25, 07:52 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-03-19T10:07:22+00:00" > 03/19/25, 10:07 </span>
Hey Florian,
the serialisation contains:
O:54:"TYPO3\CMS\Scheduler\Task\RecyclerGarbageCollectionTask":9:{s:12:" * scheduler";N;s:10:" * taskUid";i:17;s:11:" * disabled";b:0;s:19:" * runOnNextCronJob";b:0;s:12:" * execution";O:29:"TYPO3\CMS\Scheduler\Execution":6:{s:8:" * start";i:1676409300;s:6:" * end";s:0:"";s:11:" * interval";i:86400;s:11:" * multiple";s:1:"0";s:10:" * cronCmd";s:0:"";s:23:" * isNewSingleExecution";b:0;}s:16:" * executionTime";i:1742418900;s:14:" * description";s:0:"";s:12:" * taskGroup";i:1;s:12:"numberOfDays";i:30;}so “end” in this case is an empty string. Indeed this makes the code break, and earlier TYPO3 versions (v11) set the end dates like this.
The patch attached to this issue should solve this, would you be able to test this?
(Yes, a workaround is to create a new task, since v12+ will use an integer for start/end times on serialisation)
Thanks for your help!
-
Florian Seirer commented <span data-processor="relativetime" data-value="2025-03-19T10:23:10+00:00" > 03/19/25, 10:23 </span>
I tried your patch, and it works. I can edit tasks again without errors.
Thanks!
-
Gerrit Code Review pushed patch set 3 for main to change 88645 <span data-processor="relativetime" data-value="2025-03-19T12:20:38+00:00" > 03/19/25, 12:20 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 88666 <span data-processor="relativetime" data-value="2025-03-21T07:41:41+00:00" > 03/21/25, 07:41 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88667 <span data-processor="relativetime" data-value="2025-03-21T07:42:08+00:00" > 03/21/25, 07:42 </span>
-
Garvin Hicking commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-03-21T07:55:08+00:00" > 03/21/25, 07:55 </span>Applied in changeset commit:503b2d54e6ff7360bb60aff856631a47f710783d.
-
Georg Ringer changed Duplicated by #106504 <span data-processor="relativetime" data-value="2025-04-03T10:28:47+00:00" > 04/03/25, 10:28 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-08-12T14:36:35+00:00" > 08/12/25, 14:36 </span>
I get the error for all old tasks. This is a database export from one of the tasks, if that helps:
I can, however, create a new task and edit it: