Skip to content

Commit 691cc24

Browse files
author
Rudy Gnodde
committed
[TASK] TYPO3 10.2 compatibility
1 parent e48d5bf commit 691cc24

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2020-02-20 Rudy Gnodde
2+
* Version 1.0.5
3+
* TYPO3 10.2 compatibility
4+
15
2019-12-17 Rudy Gnodde
26
* Version 1.0.4
37
* Fix call to generateData in FileProvider

Classes/Controller/RandomdataCommandController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\Console\Output\OutputInterface;
2222
use TYPO3\CMS\Core\Core\Bootstrap;
2323
use TYPO3\CMS\Core\Utility\GeneralUtility;
24+
use TYPO3\CMS\Extbase\Exception;
2425
use TYPO3\CMS\Extbase\Object\ObjectManager;
2526
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException;
2627
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotReturnException;
@@ -57,7 +58,7 @@ public function configure()
5758
*
5859
* @param InputInterface $input
5960
* @param OutputInterface $output
60-
* @return int|void|null
61+
* @return int
6162
* @throws \RuntimeException
6263
* @throws ConfigurationFileNotFoundException
6364
* @throws FieldsNotFoundForItemException
@@ -69,6 +70,7 @@ public function configure()
6970
* @throws ProviderException
7071
* @throws InvalidSlotException
7172
* @throws InvalidSlotReturnException
73+
* @throws Exception
7274
*/
7375
public function execute(InputInterface $input, OutputInterface $output)
7476
{
@@ -78,5 +80,7 @@ public function execute(InputInterface $input, OutputInterface $output)
7880
/** @var RandomdataService $randomdataService */
7981
$randomdataService = $objectManager->get(RandomdataService::class);
8082
$randomdataService->generate($input->getArgument('file'), $input->getArgument('locale'), $output);
83+
84+
return 0;
8185
}
8286
}

Classes/Provider/FileProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
*/
1616

1717
use Faker\Generator;
18+
use TYPO3\CMS\Core\Core\Environment;
1819
use TYPO3\CMS\Core\Database\ConnectionPool;
1920
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
2021
use TYPO3\CMS\Core\Resource\ResourceFactory;
2122
use TYPO3\CMS\Core\Utility\GeneralUtility;
23+
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
2224
use WIND\Randomdata\Exception\ProviderException;
2325
use WIND\Randomdata\Service\RandomdataService;
2426

@@ -66,7 +68,11 @@ static public function generate(Generator $faker, array $configuration, Randomda
6668
}
6769

6870
if (!empty($configuration['source'])) {
69-
$sourceAbsolutePath = PATH_site . trim($configuration['source'], '/') . '/';
71+
if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 9002000) {
72+
$sourceAbsolutePath = PATH_site . trim($configuration['source'], '/') . '/';
73+
} else {
74+
$sourceAbsolutePath = Environment::getPublicPath() . '/' . trim($configuration['source'], '/') . '/';
75+
}
7076
if (is_dir($sourceAbsolutePath)) {
7177
$count = $faker->numberBetween($configuration['minimum'], $configuration['maximum']);
7278
$files = self::getRandomFiles($sourceAbsolutePath, $count);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "typo3-cms-extension",
55
"license": "GPL-3.0-or-later",
66
"require": {
7-
"typo3/cms-core": "^8.7 || ^9.5",
7+
"typo3/cms-core": "^8.7 || ^9.5 || ^10.2",
88
"fzaninotto/faker": "^1.8"
99
},
1010
"replace": {

ext_emconf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
'state' => 'stable',
1010
'uploadfolder' => false,
1111
'clearCacheOnLoad' => false,
12-
'version' => '1.0.4',
12+
'version' => '1.0.5',
1313
'constraints' => [
1414
'depends' => [
15-
'typo3' => '8.7.13-9.5.99',
15+
'typo3' => '8.7.13-10.2.99',
1616
],
1717
'conflicts' => [
1818
],

0 commit comments

Comments
 (0)