Bug #57393

Task #57578: TceformsUpdateWizard improvements (Migrate all file relations from tt_content.image and pages.media)

Endless Loop in TceformsUpdateWizard

Added by Benjamin Pucher over 8 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Install Tool
Target version:
Start date:
2014-03-27
Due date:
% Done:

100%

Estimated time:
0.25 h
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

I'm currently updating a large TYPO3 Website from 4.5 to 6.2 and have found a bug in the Upgrade Wizard.
The migration with title 'Migrate all file relations from tt_content.image and pages.media' (typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php) ends up in an endless loop.
The problem exists in the do/while loop starting at line 188 respectively in the getRecordsFromTable method in typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php.

188 do {
189     $records = $this->getRecordsFromTable($table, $fieldToMigrate, $fieldsToGet, self::RECORDS_PER_QUERY);
190     foreach ($records as $record) {
191         $this->migrateField($table, $record, $fieldToMigrate, $fieldConfiguration, $customMessages);
192     }
193 } while (count($records) === self::RECORDS_PER_QUERY);

self::RECORDS_PER_QUERY is set to 1000. Every time a query like 'select ... LIMIT 1000' is created. Because there's no starting point defined after the LIMIT statement (which should be 0 on first loop and then += self::RECORDS_PER_QUERY) the query will always fetch the first self::RECORDS_PER_QUERY entries. Thus the while condition is always true.
To fix this the LIMIT statement should have the starting point included like LIMIT <entries_fetched_so_far>, self::RECORDS_PER_QUERY.

Please fix this asap since many people will update their TYPO3 LTS Websites shortly.


Related issues

Related to TYPO3 Core - Bug #43725: TceformsUpdateWizard exceeds memory_limit/max_execution_timeClosed2012-12-07

Actions
Related to TYPO3 Core - Task #57572: TceformsUpdateWizard has to handle SQL errorsClosedMarkus Klein2014-04-02

Actions

Also available in: Atom PDF