Project

General

Profile

Actions

Bug #92501

closed

TYPO3 v9 Migration-Class SeparateSysHistoryFromSysLogUpdate causes exception on invalid log-data entries

Added by Gabriel Kaufmann / Typoworx NewMedia over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2020-10-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I've been running TYPO3 Migration through TYPO3 v9 and Upgrade-Wizard caused Exception in Migation 'SeparateSysHistoryFromSysLogUpdate'.

Caused by this piece of code in method moveDataFromSysLogToSysHistory

$logData = $row['log_data'] !== null ? (array)unserialize($row['log_data'], ['allowed_classes' => false]) : [];

Later on calling the method updateTablesAndTrackProgress will rise an exception, as in my case for some reason the 'log_data' was not unserializeable, but the function expects this argument to be an array!

There are two points how this cloud be fixed and improved fixed:

1. Improve unserialize (code pieve aboce) like this, as it is more failure proof and better concept of code-handling:
@
$logData = [];
if($row['log_data'] !== null) {
$logData = (array)unserialize($row['log_data'], ['allowed_classes' => false]);
}
@

or even better and cleaner:
@
$logData = [];
if($row['log_data'] !== null) {
if(!!($tmp = (array)unserialize($row['log_data'], ['allowed_classes' => false])) {
$row['log_data'] = $tmp;
}
}
@

2. there's already a try/catch around updateTablesAndTrackProgress,
but we could catch the TypeError separately and may be create some kind of logging or report which records where failing.

Simply add this right before the existing catch \Exception

} catch (\TypeError $e) {
// ignore, log, create report for Migration?!
} catch (\Exception $up) {
$connection->rollBack();
throw ($up);
}


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #91042: SeparateSysHistoryFromSysLog upgrade wizard type errorClosed2020-04-15

Actions
Actions #1

Updated by Markus Klein over 3 years ago

  • Is duplicate of Bug #91042: SeparateSysHistoryFromSysLog upgrade wizard type error added
Actions #2

Updated by Markus Klein over 3 years ago

  • Status changed from New to Closed

Closing this as duplicate.

Actions

Also available in: Atom PDF