Saving a scheduler task without any changes leads to 0 affected
rows which must not be interpreted as an error.
Resolves: #85366
Releases: master, 8.7
Change-Id: I474e16478cb09ad4940aaab5fe1d3eb21498c4c4
Reviewed-on: https://review.typo3.org/57491
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
*/
public function saveTask(Task\AbstractTask $task)
{
+ $result = true;
$taskUid = $task->getTaskUid();
if (!empty($taskUid)) {
try {
'task_group' => $task->getTaskGroup(),
'serialized_task_object' => serialize($task)
];
- $result = GeneralUtility::makeInstance(ConnectionPool::class)
- ->getConnectionForTable('tx_scheduler_task')
- ->update(
- 'tx_scheduler_task',
- $fields,
- ['uid' => $taskUid],
- ['serialized_task_object' => Connection::PARAM_LOB]
- );
+ try {
+ GeneralUtility::makeInstance(ConnectionPool::class)
+ ->getConnectionForTable('tx_scheduler_task')
+ ->update(
+ 'tx_scheduler_task',
+ $fields,
+ ['uid' => $taskUid],
+ ['serialized_task_object' => Connection::PARAM_LOB]
+ );
+ } catch (\Doctrine\DBAL\DBALException $e) {
+ $result = false;
+ }
} else {
$result = false;
}