Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(major): TRON-64448 added support for TYPO3 v13 #160

Merged
merged 19 commits into from
Nov 22, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
matrix:
include:
- php-version: 8.1
- php-version: 8.2
- php-version: 8.3
steps:
- uses: actions/checkout@v2

Expand All @@ -36,4 +36,4 @@ jobs:

- run: composer install --no-progress

- run: vendor/bin/phpstan analyse Classes -c phpstan.neon
- run: vendor/bin/phpstan analyse Classes -c phpstan.neon
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.0.0] - 2024-11-22 v13 Support

### Added

- TYPO3 13 support

### Changed

- Breaking: Filepond uploads are now handled by a different endpoint, check your FileopondConfig.html if you have overridden the template

### Removed

- Dropped support for v12

## [3.0.6] - 2024-11-22 Bugfix Release

### Added
Expand Down
20 changes: 16 additions & 4 deletions Classes/Command/AnonymizeApplicationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use TYPO3\CMS\Core\Resource\Exception\InvalidFileNameException;
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use ITX\Jobapplications\Service\ConfigurationLoaderService;

/**
* Task for deleting all applications older than a specific amount of time
Expand All @@ -49,16 +50,19 @@ class AnonymizeApplicationsCommand extends Command
public int $days = 90;
public int $status = 0;

protected ConfigurationLoaderService $configurationLoaderService;
protected PersistenceManager $persistenceManager;
protected ApplicationRepository $applicationRepository;
protected ApplicationFileService $applicationFileService;

public function __construct(PersistenceManager $persistenceManager,
ApplicationRepository $applicationRepository,
ApplicationFileService $applicationFileService,
LoggerInterface $logger
public function __construct(ConfigurationLoaderService $configurationLoaderService,
PersistenceManager $persistenceManager,
ApplicationRepository $applicationRepository,
ApplicationFileService $applicationFileService,
LoggerInterface $logger
)
{
$this->configurationLoaderService = $configurationLoaderService;
$this->persistenceManager = $persistenceManager;
$this->applicationRepository = $applicationRepository;
$this->applicationFileService = $applicationFileService;
Expand Down Expand Up @@ -86,6 +90,14 @@ public function configure()
*/
public function execute($input, $output): int
{
/*
* Issue: Repositories currently can't be used in TYPO3 v13 inside commands,
* unless the ConfigurationManager is loaded in manually. This function
* does that for us.
* Link: https://forge.typo3.org/issues/105616
*/
$this->configurationLoaderService->initCliEnvironment();
paeddym marked this conversation as resolved.
Show resolved Hide resolved

$anonymizeChars = "***";
$days = $input->getArgument('days') ?? 90;
$withStatus = $input->getOption('withStatus') ?? false;
Expand Down
20 changes: 16 additions & 4 deletions Classes/Command/CleanUpApplicationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException;
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use ITX\Jobapplications\Service\ConfigurationLoaderService;

/**
* Task for deleting all applications older than a specific amount of time
Expand All @@ -46,15 +47,18 @@ class CleanUpApplicationsCommand extends Command
{
private LoggerInterface $logger;

protected ConfigurationLoaderService $configurationLoaderService;
protected PersistenceManager $persistenceManager;
protected ApplicationRepository $applicationRepository;
protected ApplicationFileService $applicationFileService;

public function __construct(PersistenceManager $persistenceManager,
ApplicationRepository $applicationRepository,
ApplicationFileService $applicationFileService,
LoggerInterface $logger)
public function __construct(ConfigurationLoaderService $configurationLoaderService,
PersistenceManager $persistenceManager,
ApplicationRepository $applicationRepository,
ApplicationFileService $applicationFileService,
LoggerInterface $logger)
{
$this->configurationLoaderService = $configurationLoaderService;
paeddym marked this conversation as resolved.
Show resolved Hide resolved
$this->persistenceManager = $persistenceManager;
$this->applicationRepository = $applicationRepository;
$this->applicationFileService = $applicationFileService;
Expand Down Expand Up @@ -83,6 +87,14 @@ public function configure()
*/
public function execute($input, $output): int
{
/*
* Issue: Repositories currently can't be used in TYPO3 v13 inside commands,
* unless the ConfigurationManager is loaded in manually. This function
* does that for us.
* Link: https://forge.typo3.org/issues/105616
*/
$this->configurationLoaderService->initCliEnvironment();

$days = $input->getArgument('days') ?? 90;
$withStatus = $input->getOption('withStatus') ?? false;

Expand Down
160 changes: 0 additions & 160 deletions Classes/Controller/AjaxController.php

This file was deleted.

19 changes: 9 additions & 10 deletions Classes/Controller/ApplicationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use ITX\Jobapplications\Event\BeforeApplicationPersisted;
use ITX\Jobapplications\PageTitle\JobsPageTitleProvider;
use ITX\Jobapplications\Service\ApplicationFileService;
use ITX\Jobapplications\Utility\Typo3VersionUtility;
use ITX\Jobapplications\Utility\UploadFileUtility;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LogLevel;
Expand All @@ -46,7 +45,6 @@
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Mail\FluidEmail;
use TYPO3\CMS\Core\Mail\Mailer;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Resource\Driver\LocalDriver;
use TYPO3\CMS\Core\Resource\Exception\ExistingTargetFileNameException;
use TYPO3\CMS\Core\Resource\Exception\ExistingTargetFolderException;
Expand All @@ -57,7 +55,8 @@
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\ResourceStorageInterface;
use TYPO3\CMS\Core\Resource\StorageRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MailUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
Expand Down Expand Up @@ -371,7 +370,7 @@ public function createAction(Application $newApplication, Posting $posting = nul
// front end check is already covered, this should only block requests avoiding the frontend
if (array_key_exists("messageMaxLength", $this->settings) && (strlen($newApplication->getMessage()) > (int)$this->settings['messageMaxLength']))
{
$this->addFlashMessage("Message too long", "Rejected", FlashMessage::ERROR);
$this->addFlashMessage("Message too long", "Rejected", ContextualFeedbackSeverity::ERROR);
$this->redirect("new", "Application", null, ["posting" => $posting]);
}

Expand Down Expand Up @@ -715,13 +714,13 @@ private function buildRelations(int $objectUid, int $fileUid, int $objectPid, st
}
}

/**
* @param array $arguments
* @param Posting|null $posting
* @param Application|null $newApplication
*
/**
* @param array $arguments
* @param Posting|null $posting
* @param Application|null $newApplication
*
* @return ResponseInterface|null
*/
*/
private function checkHoneypot(array $arguments, ?Posting $posting, ?Application $newApplication): ResponseInterface | null
{
if (($newApplication && ($arguments["new_mail"] ?? '') !== '')) {
Expand Down
Loading
Loading