We encountered an issue where the migration would fail because $fieldsService->getLayoutById() would return null for a layout where dateDeleted was set.
By skipping the label processing here during the check for the layout details we also make sure that the empty layout does not get processed later in the method where it tries to write directly to the database.
This should still perform OK as the Fields service caches layout results internally.
We encountered an issue where the migration would fail because
$fieldsService->getLayoutById()
would returnnull
for a layout wheredateDeleted
was set.By skipping the label processing here during the check for the layout details we also make sure that the empty layout does not get processed later in the method where it tries to write directly to the database.
This should still perform OK as the Fields service caches layout results internally.