Skip to content

Commit

Permalink
Bugfix for return value from type conversion (#156)
Browse files Browse the repository at this point in the history
* [BUGFIX] Add AbstractFile to conversionInterfaces due to null return of type to type conversion.

* [FEATURE] on release set ext_emconf version from tag

---------

Co-authored-by: Ulrich Mathes <[email protected]>
  • Loading branch information
MaxAmann-sitegeist and ulrichmathes authored May 22, 2024
1 parent b4fef30 commit 6d6b39c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
7 changes: 6 additions & 1 deletion Classes/Utility/ComponentArgumentConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use SMS\FluidComponents\Interfaces\ConstructibleFromInteger;
use SMS\FluidComponents\Interfaces\ConstructibleFromNull;
use SMS\FluidComponents\Interfaces\ConstructibleFromString;
use TYPO3\CMS\Core\Resource\AbstractFile;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;

Expand Down Expand Up @@ -59,7 +60,11 @@ class ComponentArgumentConverter implements \TYPO3\CMS\Core\SingletonInterface
FileReference::class => [
ConstructibleFromExtbaseFile::class,
'fromExtbaseFile'
]
],
AbstractFile::class => [
ConstructibleFromFileInterface::class,
'fromFileInterface'
],
];

/**
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"TYPO3\\TestingFramework\\Composer\\ExtensionTestEnvironment::prepare"
],
"prepare-release": [
"sed -i'' -e \"s/'version' => ''/'version' => '$(echo ${GITHUB_REF#refs/tags/} | sed 's/v//')'/\" ext_emconf.php",
"rm -r .github .ecrc .editorconfig .gitattributes Build Tests"
]
}
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'state' => 'stable',
'uploadfolder' => false,
'clearCacheOnLoad' => false,
'version' => '3.7.0',
'version' => '',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-12.9.99',
Expand Down
24 changes: 13 additions & 11 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['fc'][] = 'SMS\\FluidComponents\\ViewHelpers';

// Register type aliases
if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases'])) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases'] = [];
}
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['File'] = \SMS\FluidComponents\Domain\Model\File::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['Image'] = \SMS\FluidComponents\Domain\Model\Image::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['Link'] = \SMS\FluidComponents\Domain\Model\Link::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['Typolink'] = \SMS\FluidComponents\Domain\Model\Typolink::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['Navigation'] = \SMS\FluidComponents\Domain\Model\Navigation::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['NavigationItem'] = \SMS\FluidComponents\Domain\Model\NavigationItem::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['Labels'] = \SMS\FluidComponents\Domain\Model\Labels::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases']['Slot'] = \SMS\FluidComponents\Domain\Model\Slot::class;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases'] = array_merge(
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['typeAliases'] ?? [],
[
'File' => \SMS\FluidComponents\Domain\Model\File::class,
'Image' => \SMS\FluidComponents\Domain\Model\Image::class,
'Labels' => \SMS\FluidComponents\Domain\Model\Labels::class,
'Link' => \SMS\FluidComponents\Domain\Model\Link::class,
'Navigation' => \SMS\FluidComponents\Domain\Model\Navigation::class,
'NavigationItem' => \SMS\FluidComponents\Domain\Model\NavigationItem::class,
'Slot' => \SMS\FluidComponents\Domain\Model\Slot::class,
'Typolink' => \SMS\FluidComponents\Domain\Model\Typolink::class,
]
);

if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['fluidComponents.partialsInComponents'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['fluidComponents.partialsInComponents'] = false;
Expand Down

0 comments on commit 6d6b39c

Please sign in to comment.