Skip to content

Commit

Permalink
[TASK] Migrate media fields to file
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Jul 4, 2023
1 parent 73d459c commit 17a6bed
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 700 deletions.
4 changes: 0 additions & 4 deletions Build/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ parameters:
ignoreErrors:
- "#Casting to string something that's already string.#"
- "#^Call to an undefined method TYPO3Fluid\\\\Fluid\\\\Core\\\\Rendering\\\\RenderingContextInterface\\:\\:getRequest\\(\\)\\.$#"
- """
#^Call to deprecated method getFileFieldTCAConfig\\(\\) of class TYPO3\\\\CMS\\\\Core\\\\Utility\\\\ExtensionManagementUtility\\:
since TYPO3 v12\\.0\\. Use the TCA type "file" directly$#
"""

paths:
- %currentWorkingDirectory%/Classes/
Expand Down
61 changes: 0 additions & 61 deletions Classes/Utility/TcaUtility.php

This file was deleted.

112 changes: 26 additions & 86 deletions Configuration/TCA/Overrides/100_pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,102 +78,42 @@
'nav_icon' => [
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:pages.nav_icon',
'displayCond' => 'FIELD:nav_icon_set:REQ:false',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'nav_icon',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;;filePalette
'
],
'config' => [
'type' => 'file',
'allowed' => ['gif', 'png', 'svg'],
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/Database.xlf:tt_content.asset_references.addFileReference',
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '--palette--;;filePalette'
],
],
'maxitems' => 1,
],
'gif,png,svg'
),
'minitems' => 0,
'maxitems' => 1,
],
],
'thumbnail' => [
'exclude' => true,
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:pages.thumbnail',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'thumbnail',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
title,
alternative,
crop,
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;;filePalette
'
],
'config' => [
'type' => 'file',
'allowed' => 'common-image-types',
'minitems' => 0,
'maxitems' => 1,
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;;imageoverlayPalette,
--palette--;;filePalette
'
],
],
'minitems' => 0,
'maxitems' => 1,
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
],
'l10n_mode' => 'exclude',
],
]
Expand Down
4 changes: 3 additions & 1 deletion Configuration/TCA/Overrides/201_content_element_audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
',
'columnsOverrides' => [
'assets' => [
'config' => \BK2K\BootstrapPackage\Utility\TcaUtility::getConfigForFileExtensions(['mp3']),
'config' => [
'allowed' => ['mp3'],
]
]
]
]
Expand Down
4 changes: 3 additions & 1 deletion Configuration/TCA/Overrides/207_content_element_csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
',
'columnsOverrides' => [
'media' => [
'config' => \BK2K\BootstrapPackage\Utility\TcaUtility::getConfigForFileExtensions(['csv']),
'config' => [
'allowed' => ['csv'],
]
]
]
]
Expand Down
4 changes: 3 additions & 1 deletion Configuration/TCA/Overrides/213_content_element_media.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
',
'columnsOverrides' => [
'assets' => [
'config' => \BK2K\BootstrapPackage\Utility\TcaUtility::getConfigForFileExtensions(['youtube', 'vimeo']),
'config' => [
'allowed' => ['youtube', 'vimeo']
],
]
]
]
Expand Down
55 changes: 13 additions & 42 deletions Configuration/TCA/Overrides/225_content_element_texticon.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,51 +115,22 @@
'icon_file' => [
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.icon_file',
'displayCond' => 'FIELD:icon_set:REQ:false',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'icon_file',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;;filePalette
'
],
'config' => [
'type' => 'file',
'allowed' => ['gif', 'png', 'svg'],
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/Database.xlf:tt_content.asset_references.addFileReference',
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '--palette--;;filePalette'
],
],
'minitems' => 1,
'maxitems' => 1,
],
'gif,png,svg'
),
'minitems' => 0,
'maxitems' => 1,
],
],
'icon_position' => [
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.icon_position',
Expand Down
56 changes: 13 additions & 43 deletions Configuration/TCA/Overrides/300_content_general_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,52 +109,22 @@
'exclude' => true,
'displayCond' => 'FIELD:frame_class:!=:none',
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.background_image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'background_image',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
crop,
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;;filePalette
'
],
'config' => [
'type' => 'file',
'allowed' => 'common-image-types',
'minitems' => 0,
'maxitems' => 1,
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => 'crop,--palette--;;filePalette'
],
],
'minitems' => 0,
'maxitems' => 1,
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
],
'l10n_mode' => 'exclude',
];
$GLOBALS['TCA']['tt_content']['columns']['background_image_options'] = [
Expand Down
Loading

0 comments on commit 17a6bed

Please sign in to comment.