MigrationRepository incorrectly uses fuzzy "like('%...%')" instead of precise "eq('...')" for several SQL statements

First of all, thank you for this very useful extension!

The current MigrationRepository version uses like '%...%' expressions.

This fuzzy matching can cause incorrect "source gridelement type to target container types" migrations.

Example

A TYPO3 installation uses custom gridelement types named like so:

1
2
3
...
9
10
11
12

These gridelement types shall now be migrated to container elements "a, b, c, ...":

1 -> a
2 -> b
3 -> c
...
10 -> j
11 -> k
12 -> l

The following TYPO3 commands will initiate the migration:

vendor/bin/typo3cms gridtocontainer:migrateall 1 a old 10 10
vendor/bin/typo3cms gridtocontainer:migrateall 2 b old 10 10
vendor/bin/typo3cms gridtocontainer:migrateall 3 c old 10 10
...
vendor/bin/typo3cms gridtocontainer:migrateall 10 j old 10 10
vendor/bin/typo3cms gridtocontainer:migrateall 11 k old 10 10
vendor/bin/typo3cms gridtocontainer:migrateall 12 l old 10 10

The migration 1 -> a incorrectly migrates gridelement types "10, 11, and 12" to container type "a" as well, because like '%1%' matches 10, 11, and 12 as well.

Solution

like expressions should be changed to eq, e.g. $queryBuilder->expr()->eq('tx_gridelements_backend_layout', $key)