Skip to content

Commit

Permalink
Revert "Basic compatibility to TYPO3 11.5 and 12.4"
Browse files Browse the repository at this point in the history
This reverts commit c3baa93.
  • Loading branch information
mcrasser committed May 27, 2024
1 parent c3baa93 commit 9aec45c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/phpci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "7.2"
- "7.3"
- "7.4"

steps:
-
Expand Down Expand Up @@ -71,9 +71,9 @@ jobs:
- "test:phpmd"
- "test:phpstan"
php-version:
- "8.1"
- "8.2"
- "8.3"
- "7.2"
- "7.3"
- "7.4"

steps:
-
Expand Down Expand Up @@ -119,9 +119,9 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "7.2"
- "7.3"
- "7.4"

steps:
-
Expand Down
21 changes: 13 additions & 8 deletions Classes/Task/CleanerTaskFieldProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

namespace DMK\Mkcleaner\Task;

use TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface;
Expand All @@ -42,19 +40,21 @@
* @license http://www.gnu.org/licenses/lgpl.html
* GNU Lesser General Public License, version 3 or later
*/
class CleanerTaskFieldProvider extends AbstractAdditionalFieldProvider
class CleanerTaskFieldProvider implements AdditionalFieldProviderInterface
{
/**
* @var Helper
*/
protected $taskHelper;

/**
* @todo use DI with newer TYPO3 versions
*/
public function __construct(Helper $taskHelper = null)
{
$this->taskHelper = $taskHelper ?? GeneralUtility::makeInstance(Helper::class);
}

/**
* @param array<string> $taskInfo
* @param CleanerTask $task
Expand All @@ -64,7 +64,7 @@ public function __construct(Helper $taskHelper = null)
public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $parentObject)
{
$fieldName = 'foldersToClean';
if ('edit' == (string) $parentObject->getCurrentAction()) {
if ('edit' == $parentObject->CMD) {
$taskInfo[$fieldName] = $task->getFoldersToClean();
}
$fieldHtml = '<textarea class="form-control" rows="5" cols="50" name="tx_scheduler['.$fieldName.']" id="'
Expand All @@ -79,6 +79,7 @@ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleCont
],
];
}

/**
* @param array<string, string> $submittedData
*
Expand All @@ -92,14 +93,18 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC

return true;
} catch (\Exception $e) {
$this->addMessage(sprintf(
$GLOBALS['LANG']->sL('LLL:EXT:mkcleaner/Resources/Private/Language/locallang.xlf:message.CleanerTask.foldersToClean.invalid'),
$e->getMessage()
), AbstractMessage::ERROR);
$parentObject->addMessage(
sprintf(
$GLOBALS['LANG']->sL('LLL:EXT:mkcleaner/Resources/Private/Language/locallang.xlf:message.CleanerTask.foldersToClean.invalid'),
$e->getMessage()
),
FlashMessage::ERROR
);

return false;
}
}

/**
* @param array<string, string> $submittedData
* @param CleanerTask $task
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MK Cleaner
=======

![TYPO3 compatibility](https://img.shields.io/badge/TYPO3-11.5%20%7C%2012.4-orange?maxAge=3600&style=flat-square&logo=typo3)
![TYPO3 compatibility](https://img.shields.io/badge/TYPO3-8.7-orange?maxAge=3600&style=flat-square&logo=typo3)
[![Latest Stable Version](https://img.shields.io/packagist/v/dmk/mkcleaner.svg?maxAge=3600&style=flat-square&logo=composer)](https://packagist.org/packages/dmk/mkcleaner)
[![Total Downloads](https://img.shields.io/packagist/dt/dmk/mkcleaner.svg?maxAge=3600&style=flat-square)](https://packagist.org/packages/dmk/mkcleaner)
[![Build Status](https://img.shields.io/github/actions/workflow/status/DMKEBUSINESSGMBH/typo3-mkcleaner/.github/workflows/phpci.yml?maxAge=3600&style=flat-square&logo=github-actions)](https://github.com/DMKEBUSINESSGMBH/typo3-mkcleaner/actions?query=workflow%3APHP-CI)
Expand Down
5 changes: 2 additions & 3 deletions Tests/Unit/Task/CleanerTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@

namespace DMK\Mkcleaner\Tests\Task;

use PHPUnit\Framework\MockObject\MockObject;
use TYPO3\CMS\Core\Localization\LanguageService;
use DMK\Mkcleaner\Service\CleanerService;
use DMK\Mkcleaner\Task\CleanerTask;
use DMK\Mkcleaner\Task\Helper;
use Nimut\TestingFramework\TestCase\UnitTestCase;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Lang\LanguageService;

/**
* Class CleanerTaskTest.
Expand All @@ -46,7 +45,7 @@
class CleanerTaskTest extends UnitTestCase
{
/**
* @var CleanerTask|MockObject
* @var CleanerTask|\PHPUnit\Framework\MockObject\MockObject
*/
protected $task;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Task/CleanupTaskFieldProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@

namespace DMK\Mkcleaner\Tests\Task;

use TYPO3\CMS\Core\Localization\LanguageService;
use DMK\Mkcleaner\Task\CleanerTask;
use DMK\Mkcleaner\Task\CleanerTaskFieldProvider;
use DMK\Mkcleaner\Task\Helper;
use Nimut\TestingFramework\TestCase\UnitTestCase;
use TYPO3\CMS\Lang\LanguageService;
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController;

/**
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"issues": "https://github.com/DMKEBUSINESSGMBH/typo3-mkcleaner"
},
"require": {
"typo3/cms-core": "^11.5 || ^12.4",
"php": "^8.1 || ^8.2 || ^8.3"
"typo3/cms": "~8.7",
"php": "^7.2 || ^7.3 || ^7.4"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.3",
Expand Down
7 changes: 7 additions & 0 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@
'author' => 'Hannes Bochmann',
'author_email' => 'dev@dmk-ebusiness.com',
'author_company' => 'DMK E-BUSINESS GmbH',
'shy' => 0,
'version' => '8.0.2',
'priority' => '',
'module' => '',
'state' => 'stable',
'internal' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'constraints' => [
'depends' => [
'typo3' => '8.7.0-8.7.99',
Expand Down
2 changes: 1 addition & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* This copyright notice MUST APPEAR in all copies of the script!
*/

if (!defined('TYPO3')) {
if (!defined('TYPO3_MODE')) {
exit('Access denied.');
}
call_user_func(
Expand Down
2 changes: 1 addition & 1 deletion ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* This copyright notice MUST APPEAR in all copies of the script!
*/

defined('TYPO3') or exit();
defined('TYPO3_MODE') or exit();

if (TYPO3_MODE === 'BE') {
// Add context sensitive help (csh) to the scheduler module
Expand Down

0 comments on commit 9aec45c

Please sign in to comment.