Hero placeholder fieldname: vitec_hero_bgimage (content block prefix)

The vitec/herosection content block has prefixFields - the real column
and sys_file_reference fieldname is vitec_hero_bgimage; the JSON merely
strips the prefix. The first apply wrote the 20 references with the bare
name, so they existed but never rendered (no herosection anywhere had an
image, so there was no working example to catch it against).

- BuildProductOverviews: attach/backfill/skip-check now use
  vitec_hero_bgimage
- new migration fix_overview_hero_refs.php: renames the existing 20
  references in place (no re-attach) and sets the counter column

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
orascheandClaude Fable 5 committed 2026-11-03 18:42:06 +01:00
1 parent 77661bf0b6
commit 8e173b1a85
2 files changed
+117 -4

No files matched your search

@@ -397,7 +397,9 @@ final class BuildProductOverviewsCommand extends Command
'uid_local' => GeneralUtility::makeInstance(StorageRepository::class)
->getDefaultStorage()->getFile($placeholder)->getUid(),
];
$this->datamap['tt_content'][$heroId]['hero_bgimage'] = $refId;
// content block vitec/herosection has prefixFields - the real
// column/fieldname is vitec_hero_bgimage (JSON strips the prefix)
$this->datamap['tt_content'][$heroId]['vitec_hero_bgimage'] = $refId;
$this->report[] = ' hero: attach ' . $placeholder;
} else {
$this->report[] = ' hero: would attach ' . $placeholder;
@@ -462,7 +464,7 @@ final class BuildProductOverviewsCommand extends Command
return;
}
$existing = (int)$pool->getConnectionForTable('sys_file_reference')->fetchOne(
"SELECT COUNT(*) FROM sys_file_reference WHERE deleted = 0 AND tablenames = 'tt_content' AND fieldname = 'hero_bgimage' AND uid_foreign = ?",
"SELECT COUNT(*) FROM sys_file_reference WHERE deleted = 0 AND tablenames = 'tt_content' AND fieldname = 'vitec_hero_bgimage' AND uid_foreign = ?",
[$heroUid]
);
if ($existing > 0) {
@@ -485,9 +487,9 @@ final class BuildProductOverviewsCommand extends Command
->getDefaultStorage()->getFile($placeholder)->getUid(),
'tablenames' => 'tt_content',
'uid_foreign' => $heroUid,
'fieldname' => 'hero_bgimage',
'fieldname' => 'vitec_hero_bgimage',
];
$this->datamap['tt_content'][$heroUid]['hero_bgimage'] = 1;
$this->datamap['tt_content'][$heroUid]['vitec_hero_bgimage'] = 1;
$this->report[] = ' hero #' . $heroUid . ': attach ' . $placeholder;
}