diff --git a/Classes/Command/LinkMigrationCommandController.php b/Classes/Command/LinkMigrationCommandController.php index 2fd7901..1462c1b 100644 --- a/Classes/Command/LinkMigrationCommandController.php +++ b/Classes/Command/LinkMigrationCommandController.php @@ -151,7 +151,8 @@ protected function gatherRecordsToMigrate($table, $listOfFields) // The last string is optional. If it exists, it is already a 4-part record reference, // i.e. a reference using the new syntax and which does not need to be migrated. preg_match_all('/record:(\w+):(\w+)(:\w+)?/', $record[$field], $matches); - foreach ($matches as $index => $match) { + $numberOfMatches = count ($matches[0]); + for ($index = 0; $index < $numberOfMatches; $index++) { // Consider only matches that have 3 parts (i.e. 4th part is empty) // NOTE: although not captured, the first part is "record:" if ($matches[3][$index] === '') {