Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 7.0.0 (2025-12-03)

Update typo3/cms-core version requirement
fixup! [BUGFIX] fix errors
[BUGFIX] fix errors
[BUGFIX] fix errors corrections
[TASK] Remove v11 legacy code
Update composer.json
[BUGFIX] Remove dependency to laravel/pint
[BUGFIX] Stop export download to open a new backend window
[BUGFIX] Fix export file download using a response object
[BUGFIX] Fix value type for content length header
[FEATURE] Introduce class property for facets
[TASK] Remove unwanted dropdown menu markup
[BUGFIX] Fix user TSConfig retrieval

## 6.0.0 (2022-11-17)

[BUGFIX] Correct interface signature for php >= 8.0
Expand Down
5 changes: 4 additions & 1 deletion Classes/Backend/LanguageFileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class LanguageFileGenerator implements SingletonInterface
</body>
</file>
</xliff>';
public function __construct(private readonly \TYPO3\CMS\Core\Localization\LanguageServiceFactory $languageServiceFactory)
{
}

/**
* @param string $dataType
Expand Down Expand Up @@ -87,7 +90,7 @@ protected function getLanguageService()
if ($locale === '') {
$locale = 'en';
}
$languageServiceFactory = GeneralUtility::makeInstance(LanguageServiceFactory::class);
$languageServiceFactory = $this->languageServiceFactory;
return $languageServiceFactory->create($locale);
}
}
72 changes: 0 additions & 72 deletions Classes/Command/VidiCommand.php

This file was deleted.

2 changes: 1 addition & 1 deletion Classes/Configuration/ConfigurationUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function get($key)
* @param mixed $value
* @return void
*/
public function set($key, $value)
public function set($key, $value): void
{
$this->configuration[$key] = $value;
}
Expand Down
5 changes: 2 additions & 3 deletions Classes/Configuration/TcaGridAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@
use Fab\Vidi\Grid\ButtonGroupRenderer;
use Fab\Vidi\Grid\CheckBoxRenderer;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
* Add a Grid TCA to each "data type" enabling to display a Vidi module in the BE.
*/
class TcaGridAspect implements TableConfigurationPostProcessingHookInterface
class TcaGridAspect
{
/**
* Scans each data type of the TCA and add a Grid TCA if missing.
*
* implements TableConfigurationPostProcessingHookInterface
* @return array
*/
public function processData()
Expand Down
5 changes: 2 additions & 3 deletions Classes/Configuration/VidiModulesAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@
*/
use Fab\Vidi\Module\ModuleLoader;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
* Initialize Vidi modules
*/
class VidiModulesAspect implements TableConfigurationPostProcessingHookInterface
class VidiModulesAspect
{
/**
* Initialize and populate TBE_MODULES_EXT with default data.
*
* @return void
*/
public function processData()
public function processData(): void
{
/** @var ModuleLoader $moduleLoader */
$moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/ClipboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function showAction(): ResponseInterface
$contentService = $this->getContentService()->findBy($matcher);

// count number of items and display it.
$this->view->assign('target', GeneralUtility::_GP('id'));
$this->view->assign('target', $this->request->getParsedBody()['id'] ?? $this->request->getQueryParams()['id'] ?? null);
$this->view->assign('numberOfObjects', $contentService->getNumberOfObjects());
$this->view->assign('objects', $contentService->getObjects());
return $this->htmlResponse();
Expand Down
47 changes: 23 additions & 24 deletions Classes/Controller/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@
use Fab\Vidi\Persistence\PagerObjectFactory;
use Fab\Vidi\Signal\ProcessContentDataSignalArguments;
use Fab\Vidi\Tca\Tca;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;

/**
* Controller which handles actions related to Vidi in the Backend.
*/
class ContentController extends ActionController
{
public function __construct(private readonly \Fab\Vidi\Domain\Repository\SelectionRepository $selectionRepository)
{
}
/**
* Initialize every action.
*/
public function initializeAction()
public function initializeAction():void
{
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->addInlineLanguageLabelFile('EXT:vidi/Resources/Private/Language/locallang.xlf');
Expand Down Expand Up @@ -84,10 +86,10 @@ public function indexAction(): ResponseInterface
*
* @param array $columns corresponds to columns to be rendered.
* @param array $matches
* @Validate("Fab\Vidi\Domain\Validator\ColumnsValidator", param="columns")
* @Validate("Fab\Vidi\Domain\Validator\MatchesValidator", param="matches")
* @return void
*/
#[Validate(['validator' => \Fab\Vidi\Domain\Validator\ColumnsValidator::class, 'param' => 'columns'])]
#[Validate(['validator' => \Fab\Vidi\Domain\Validator\MatchesValidator::class, 'param' => 'matches'])]
public function listAction(array $columns = [], $matches = []): ResponseInterface
{
// Initialize some objects related to the query.
Expand Down Expand Up @@ -134,7 +136,7 @@ public function listAction(array $columns = [], $matches = []): ResponseInterfac
* @param array $columns
* @throws InvalidKeyInArrayException
*/
public function updateAction($fieldNameAndPath, array $content, array $matches = [], $savingBehavior = SavingBehavior::REPLACE, $language = 0, $columns = [])
public function updateAction($fieldNameAndPath, array $content, array $matches = [], $savingBehavior = SavingBehavior::REPLACE, $language = 0, $columns = []): \Psr\Http\Message\ResponseInterface
{
// Instantiate the Matcher object according different rules.
$matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);
Expand Down Expand Up @@ -231,7 +233,7 @@ public function updateAction($fieldNameAndPath, array $content, array $matches =
* @param array $matches
* @param int $previousIdentifier
*/
public function sortAction(array $matches = [], $previousIdentifier = null)
public function sortAction(array $matches = [], $previousIdentifier = null): \Psr\Http\Message\ResponseInterface
{
$matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);

Expand Down Expand Up @@ -386,7 +388,7 @@ public function editAction($fieldNameAndPath, array $matches = [], $hasRecursive
*
* @param array $matches
*/
public function deleteAction(array $matches = [])
public function deleteAction(array $matches = []): \Psr\Http\Message\ResponseInterface
{
$matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);

Expand Down Expand Up @@ -447,7 +449,7 @@ public function copyAction($target, array $matches = [])
* @param string $target
* @throws \Exception
*/
public function copyClipboardAction($target)
public function copyClipboardAction($target): \Psr\Http\Message\ResponseInterface
{
// Retrieve matcher object from clipboard.
$matcher = $this->getClipboardService()->getMatcher();
Expand Down Expand Up @@ -482,7 +484,7 @@ public function copyClipboardAction($target)
}

// Flush Clipboard if told so.
if (GeneralUtility::_GP('flushClipboard')) {
if ($this->request->getParsedBody()['flushClipboard'] ?? $this->request->getQueryParams()['flushClipboard'] ?? null) {
$this->getClipboardService()->flush();
}

Expand All @@ -500,7 +502,7 @@ public function copyClipboardAction($target)
* @param string $target
* @param array $matches
*/
public function moveAction($target, array $matches = [])
public function moveAction($target, array $matches = []): \Psr\Http\Message\ResponseInterface
{
$matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);

Expand Down Expand Up @@ -544,7 +546,7 @@ public function moveAction($target, array $matches = [])
*
* @param string $target
*/
public function moveClipboardAction($target)
public function moveClipboardAction($target): \Psr\Http\Message\ResponseInterface
{
// Retrieve matcher object from clipboard.
$matcher = $this->getClipboardService()->getMatcher();
Expand Down Expand Up @@ -579,7 +581,7 @@ public function moveClipboardAction($target)
}

// Flush Clipboard if told so.
if (GeneralUtility::_GP('flushClipboard')) {
if ($this->request->getParsedBody()['flushClipboard'] ?? $this->request->getQueryParams()['flushClipboard'] ?? null) {
$this->getClipboardService()->flush();
}

Expand All @@ -599,7 +601,7 @@ public function moveClipboardAction($target)
* @param int $language
* @throws \Exception
*/
public function localizeAction($fieldNameAndPath, array $matches = [], $language = 0)
public function localizeAction($fieldNameAndPath, array $matches = [], $language = 0): \Psr\Http\Message\ResponseInterface
{
$matcher = MatcherObjectFactory::getInstance()->getMatcher($matches);

Expand Down Expand Up @@ -655,7 +657,9 @@ public function localizeAction($fieldNameAndPath, array $matches = [], $language
/** @var EditUri $uri */
$uriRenderer = GeneralUtility::makeInstance(EditUri::class);
$uri = $uriRenderer->render($localizedContent);
HttpUtility::redirect($uri);

$response = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Psr\Http\Message\ResponseFactoryInterface::class)->createResponse(\TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_303)->withAddedHeader('location', $uri);
throw new \TYPO3\CMS\Core\Http\PropagateResponseException($response, 9221048242);
break; // no need to further continue
}

Expand Down Expand Up @@ -724,7 +728,7 @@ protected function emitProcessContentDataSignal(Content $contentObject, $fieldNa
->setSavingBehavior($savingBehavior)
->setLanguage($language);

$signalResult = $this->getSignalSlotDispatcher()->dispatch('Fab\Vidi\Controller\Backend\ContentController', 'processContentData', array($signalArguments));
#$signalResult = $this->getSignalSlotDispatcher()->dispatch('Fab\Vidi\Controller\Backend\ContentController', 'processContentData', array($signalArguments));
return $signalResult[0];
}

Expand All @@ -733,10 +737,10 @@ protected function emitProcessContentDataSignal(Content $contentObject, $fieldNa
*
* @return Dispatcher
*/
protected function getSignalSlotDispatcher()
{
return GeneralUtility::makeInstance(Dispatcher::class);
}
// protected function getSignalSlotDispatcher()
// {
// return GeneralUtility::makeInstance(Dispatcher::class);
// }

/**
* Get the Clipboard service.
Expand Down Expand Up @@ -765,9 +769,4 @@ protected function getModuleLoader()
{
return GeneralUtility::makeInstance(ModuleLoader::class);
}

public function injectSelectionRepository(SelectionRepository $selectionRepository): void
{
$this->selectionRepository = $selectionRepository;
}
}
6 changes: 3 additions & 3 deletions Classes/Controller/FacetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class FacetController extends ActionController
*
* @param string $facet
* @param string $searchTerm
* @Validate("Fab\Vidi\Domain\Validator\FacetValidator", param="facet")
*/
public function autoSuggestAction($facet, $searchTerm)
#[Validate(['validator' => \Fab\Vidi\Domain\Validator\FacetValidator::class, 'param' => 'facet'])]
public function autoSuggestAction($facet, $searchTerm): \Psr\Http\Message\ResponseInterface
{
$suggestions = $this->getFacetSuggestionService()->getSuggestions($facet);

Expand All @@ -43,7 +43,7 @@ public function autoSuggestAction($facet, $searchTerm)
* Suggest values for all configured facets in the Grid.
* Output a json list of key / values.
*/
public function autoSuggestsAction()
public function autoSuggestsAction(): \Psr\Http\Message\ResponseInterface
{
$suggestions = [];
foreach (Tca::grid()->getFacets() as $facet) {
Expand Down
6 changes: 3 additions & 3 deletions Classes/Controller/SelectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class SelectionController extends ActionController
/**
* @param Selection $selection
*/
public function createAction(Selection $selection = null)
public function createAction(?Selection $selection = null)
{
$selectionRepository = GeneralUtility::makeInstance(SelectionRepository::class);
$selection->setDataType($this->getModuleLoader()->getDataType());

$selection->setOwner($this->getBackendUser()->user['uid']);
$selectionRepository->add($selection);
$this->redirect('edit', 'Selection', 'vidi', array('dataType' => $selection->getDataType()));
return $this->redirect('edit', 'Selection', 'vidi', array('dataType' => $selection->getDataType()));
}

/**
Expand All @@ -53,7 +53,7 @@ public function updateAction(Selection $selection)
{
$selectionRepository = GeneralUtility::makeInstance(SelectionRepository::class);
$selectionRepository->update($selection);
$this->redirect('show', 'Selection', 'vidi', array('selection' => $selection->getUid()));
return $this->redirect('show', 'Selection', 'vidi', array('selection' => $selection->getUid()));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/ToolController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function welcomeAction(): ResponseInterface
* @param string $tool
* @param array $arguments
* @return void
* @Extbase\Validate("Fab\Vidi\Domain\Validator\ToolValidator", param="tool")
*/
#[Extbase\Validate(['validator' => \Fab\Vidi\Domain\Validator\ToolValidator::class, 'param' => 'tool'])]
public function workAction(string $tool, array $arguments = array()): ResponseInterface
{
/** @var ToolInterface $tool */
Expand Down
Loading