Skip to content
Snippets Groups Projects
Commit a5d16741 authored by Alexander Opitz's avatar Alexander Opitz Committed by Marc Bastian Heinrichs
Browse files

[BUGFIX] Limit FileTableSplittingUpdate to TYPO3 6.0/6.1

If the database field does not exist it may be that we have an
installation before 6.0 or after 6.1 so we do not need to migrate
the data to sys_file_metadata. This prevents empty metadata
information which may lead to other issues.
(width/height=0 for images)

Resolves: #57492
Related: #46020
Releases: 6.2
Change-Id: Id5826ea480d4139f2e232587fc2b119928b28bc8
Reviewed-on: https://review.typo3.org/29024
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Nicole Cordes
Reviewed-by: Anja Leichsenring
Reviewed-by: Jan Runte
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
parent 5d747910
Branches
Tags
No related merge requests found
......@@ -60,9 +60,14 @@ class FileTableSplittingUpdate extends AbstractUpdate {
if (!array_key_exists($this->metaDataTable, $GLOBALS['TYPO3_DB']->admin_get_tables())) {
$result = TRUE;
} else {
$sysFileCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'sys_file');
$sysFileMetaDataCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $this->metaDataTable);
$result = $sysFileCount > $sysFileMetaDataCount;
$fields = $GLOBALS['TYPO3_DB']->admin_get_fields('sys_file');
// Check if the field exists on sys_file if not there is no data to migrate (TYPO3 < 6.0 or >= 6.2)
if (isset($fields['width']) && isset($fields['height'])) {
// Check if the 1:1 integrity is ok, if not we need to migrate the metadata.
$sysFileCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'sys_file');
$sysFileMetaDataCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $this->metaDataTable);
$result = $sysFileCount > $sysFileMetaDataCount;
}
}
return $result;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment