Issue Bug Closed

#106383Task serialization may fail with a type error on Start/Endtime not being INT

Garvin Hicking 03/18/25, 18:14 updated 08/12/25, 14:36

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

History 712

  1. Florian Seirer commented <span data-processor="relativetime" data-value="2025-03-19T07:52:32+00:00" > 03/19/25, 07:52 </span>

    I get the error for all old tasks. This is a database export from one of the tasks, if that helps:

    uid,crdate,disable,description,nextexecution,lastexecution_time,lastexecution_failure,lastexecution_context,serialized_task_object,serialized_executions,task_group,deleted
    17,1676364108,0,"",1742418900,1742332505,"",CLI,0x4F3A35343A225459504F335C434D535C5363686564756C65725C5461736B5C52656379636C657247617262616765436F6C6C656374696F6E5461736B223A393A7B733A31323A22002A007363686564756C6572223B4E3B733A31303A22002A007461736B556964223B693A31373B733A31313A22002A0064697361626C6564223B623A303B733A31393A22002A0072756E4F6E4E65787443726F6E4A6F62223B623A303B733A31323A22002A00657865637574696F6E223B4F3A32393A225459504F335C434D535C5363686564756C65725C457865637574696F6E223A363A7B733A383A22002A007374617274223B693A313637363430393330303B733A363A22002A00656E64223B733A303A22223B733A31313A22002A00696E74657276616C223B693A38363430303B733A31313A22002A006D756C7469706C65223B733A313A2230223B733A31303A22002A0063726F6E436D64223B733A303A22223B733A32333A22002A0069734E657753696E676C65457865637574696F6E223B623A303B7D733A31363A22002A00657865637574696F6E54696D65223B693A313734323431383930303B733A31343A22002A006465736372697074696F6E223B733A303A22223B733A31323A22002A007461736B47726F7570223B693A313B733A31323A226E756D6265724F6644617973223B693A33303B7D,"",1,0

    I can, however, create a new task and edit it:

    uid,crdate,disable,description,nextexecution,lastexecution_time,lastexecution_failure,lastexecution_context,serialized_task_object,serialized_executions,task_group,deleted
    20,1742370561,0,"",1742370545,0,,"",0x4F3A35303A225459504F335C434D535C5363686564756C65725C5461736B5C4F7074696D697A6544617461626173655461626C655461736B223A393A7B733A31323A22002A007363686564756C6572223B4E3B733A31303A22002A007461736B556964223B693A32303B733A31313A22002A0064697361626C6564223B623A303B733A31393A22002A0072756E4F6E4E65787443726F6E4A6F62223B623A303B733A31323A22002A00657865637574696F6E223B4F3A32393A225459504F335C434D535C5363686564756C65725C457865637574696F6E223A363A7B733A383A22002A007374617274223B693A313734323337303534353B733A363A22002A00656E64223B693A313734323337303534353B733A31313A22002A00696E74657276616C223B693A303B733A31313A22002A006D756C7469706C65223B623A303B733A31303A22002A0063726F6E436D64223B733A303A22223B733A32333A22002A0069734E657753696E676C65457865637574696F6E223B623A303B7D733A31363A22002A00657865637574696F6E54696D65223B693A313734323337303534353B733A31343A22002A006465736372697074696F6E223B733A303A22223B733A31323A22002A007461736B47726F7570223B693A313B733A31343A2273656C65637465645461626C6573223B613A313A7B693A303B733A31343A226261636B656E645F6C61796F7574223B7D7D,,1,0
  2. 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!

  3. 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!

  4. Garvin Hicking commented and changed status Under Review Resolved done 0 % 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.