fix: slide images are shown in the backend again
The TYPO3 13 Rector migration turned the slide image column into
type=file, which matches file references by column name ("image"). The
existing references were stored as "images" by getFileFieldTCAConfig, so
the backend showed no images and flagged the required field.
The references are renamed to "image" by a one-off SQL migration. Until
that has run, the slider processor falls back to "images" so the frontend
keeps working regardless of order. The fallback is removed afterwards.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
a7b7b7a476
commit
3333eed980
2 files changed
+9
-3
No files matched your search
@@ -52,12 +52,20 @@ class SliderProcessor implements DataProcessorInterface
|
|||||||
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
|
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
|
||||||
foreach ($slides as $slide) {
|
foreach ($slides as $slide) {
|
||||||
$processedData['slides'][$slide['uid']] = $slide;
|
$processedData['slides'][$slide['uid']] = $slide;
|
||||||
$processedData['slides'][$slide['uid']]['image'] = $fileRepository->findByRelation(
|
$images = $fileRepository->findByRelation(
|
||||||
|
'tx_eptheme_domain_model_slide',
|
||||||
|
'image',
|
||||||
|
$slide['uid']
|
||||||
|
);
|
||||||
|
if ([] === $images) {
|
||||||
|
$images = $fileRepository->findByRelation(
|
||||||
'tx_eptheme_domain_model_slide',
|
'tx_eptheme_domain_model_slide',
|
||||||
'images',
|
'images',
|
||||||
$slide['uid']
|
$slide['uid']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$processedData['slides'][$slide['uid']]['image'] = $images;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 === count($slides)) {
|
if (1 === count($slides)) {
|
||||||
|
|||||||
@@ -157,8 +157,6 @@ return [
|
|||||||
'exclude' => 0,
|
'exclude' => 0,
|
||||||
'label' => 'Bild',
|
'label' => 'Bild',
|
||||||
'config' => [
|
'config' => [
|
||||||
// TODO: Important! Verify that the fieldname value in foreign table either matches the column name
|
|
||||||
// or is set properly in the following TCA, see https://docs.typo3.org/permalink/t3tca:confval-inline-foreign-match-fields
|
|
||||||
'type' => 'file',
|
'type' => 'file',
|
||||||
'allowed' => 'jpg,jpeg',
|
'allowed' => 'jpg,jpeg',
|
||||||
'appearance' => [
|
'appearance' => [
|
||||||
|
|||||||
Reference in new issue
Block a user