Skip to content

Commit a786f49

Browse files
committed
2 parents dae51fa + 955abe2 commit a786f49

File tree

73 files changed

+611
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+611
-288
lines changed

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# In2publish Core Change Log
22

3+
10.2.1:
4+
5+
- [META] Set the EM conf version number to 10.2.1
6+
- [BUGFIX] Provide performance threshold for RCE HttpAdapter
7+
- [REFACTOR] Use variables to prevent codestyle issues
8+
- [CODESTYLE] Fix imports and length exceeding lines
9+
- [CODESTYLE] Reformat config files
10+
- [BUGFIX] Define RecordFinder/-Publisher as public services
11+
- [BUGFIX] Use annotations instead of type hint and provide default value for array property
12+
- [BUGFIX] Don't fetch redirects multiple times, fix redirect merging
13+
- [BUGFIX] Resolves redirects by their t3 URI target
14+
- [BUGFIX] Introduce TaskExecutionWasFinished Event
15+
- [BUGFIX] Keep PageTsProvider disabled until the BE User was determined
16+
- [BUGFIX] Declare missing return type for EnvelopeDispatcher::getFileObject
17+
- [BUGFIX] Early return in EnvelopeDispatcher::getPublicUrl when a file could not be found
18+
- [BUGFIX] Add fallback for empty paths (especially filePreviewDomainName)
19+
- [BUGFIX] Streamline local/foreign props in Record and fix TypeError when calculating dirty props
20+
- [BUGFIX] Correctly split identifier for Record::getPageIdentifier
21+
- [BUGFIX] Cast string replacements to string before using it
22+
- [BUGFIX] Add missing import of GeneralUtility in ContextServiceTest
23+
- [BUGFIX] Use annotation instead of property type in DefaultRecordPublisher
24+
- [BUGFIX] Annotate TYPO3 variables in ext_emconf.php
25+
- [BUGFIX] Require typo3/cms-redirects for development
26+
- [CODESTYLE] Fix CS issues and imports
27+
- [BUGFIX] Rethrow the existing DBAL exception instead of creating a new one
28+
- [BUGFIX] Process the configuration in ConfigContainerExporter again
29+
- [BUGFIX] Replace non-existent class with its string representation
30+
- [BUGFIX] Remove ToolsController check from AbstractController, inheritance was removed
31+
- [BUGFIX] Fix message composing in MissingRequiredAttributesException
32+
- [BUGFIX] Return correct property in VoteIfRecordShouldBeSkipped::getCommonRepository
33+
- [BUGFIX] Declare missing property DefaultRecordPublisher::$visitedRecords
34+
- [CLEANUP] Remove nullable modifier from DefaultRecordFinder injections
35+
- [BUGFIX] Prevent registration of commands on sides which are not allowed
36+
- [BUGFIX] Set correct return type for TaskRepository::findByExecutionBegin
37+
- [BUGFIX] Ignore if "foreign_types" is used in inline MM relations
38+
- [RELEASE] Version 10.2.0 with SimplifiedOverviewAndPublish
39+
340
10.2.0:
441

542
- [META] Set the branch alias version number to 10.2.x-dev

Classes/Command/PublishTaskRunner/RunTasksInQueueCommand.php renamed to Classes/Command/Foreign/PublishTaskRunner/RunTasksInQueueCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\PublishTaskRunner;
5+
namespace In2code\In2publishCore\Command\Foreign\PublishTaskRunner;
66

77
/*
88
* Copyright notice
@@ -29,7 +29,7 @@
2929
* This copyright notice MUST APPEAR in all copies of the script!
3030
*/
3131

32-
use In2code\In2publishCore\Component\PostPublishTaskExecution\Command\RunTasksInQueueCommand as NewRunTasksInQueueCommand;
32+
use In2code\In2publishCore\Component\PostPublishTaskExecution\Command\Foreign\RunTasksInQueueCommand as NewRunTasksInQueueCommand;
3333
use In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Repository\TaskRepository;
3434
use In2code\In2publishCore\Service\Context\ContextService;
3535

@@ -38,7 +38,7 @@
3838
use const E_USER_DEPRECATED;
3939

4040
/**
41-
* @deprecated Please use \In2code\In2publishCore\Component\PostPublishTaskExecution\Command\RunTasksInQueueCommand directly
41+
* @deprecated Please use \In2code\In2publishCore\Component\PostPublishTaskExecution\Command\Foreign\RunTasksInQueueCommand directly
4242
*/
4343
class RunTasksInQueueCommand extends NewRunTasksInQueueCommand
4444
{

Classes/Command/RemoteProcedureCall/ExecuteCommand.php renamed to Classes/Command/Foreign/RemoteProcedureCall/ExecuteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\RemoteProcedureCall;
5+
namespace In2code\In2publishCore\Command\Foreign\RemoteProcedureCall;
66

77
/*
88
* Copyright notice

Classes/Command/Status/AllCommand.php renamed to Classes/Command/Foreign/Status/AllCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/AllSitesCommand.php renamed to Classes/Command/Foreign/Status/AllSitesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/ConfigFormatTestCommand.php renamed to Classes/Command/Foreign/Status/ConfigFormatTestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/CreateMasksCommand.php renamed to Classes/Command/Foreign/Status/CreateMasksCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/DbConfigTestCommand.php renamed to Classes/Command/Foreign/Status/DbConfigTestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/DbInitQueryEncodedCommand.php renamed to Classes/Command/Foreign/Status/DbInitQueryEncodedCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/EncryptionKeyCommand.php renamed to Classes/Command/Foreign/Status/EncryptionKeyCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/Exception/InvalidPageIdArgumentTypeException.php renamed to Classes/Command/Foreign/Status/Exception/InvalidPageIdArgumentTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status\Exception;
5+
namespace In2code\In2publishCore\Command\Foreign\Status\Exception;
66

77
/*
88
* Copyright notice

Classes/Command/Status/GlobalConfigurationCommand.php renamed to Classes/Command/Foreign/Status/GlobalConfigurationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/ShortSiteConfigurationCommand.php renamed to Classes/Command/Foreign/Status/ShortSiteConfigurationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/SiteConfigurationCommand.php renamed to Classes/Command/Foreign/Status/SiteConfigurationCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice
@@ -29,7 +29,7 @@
2929
* This copyright notice MUST APPEAR in all copies of the script!
3030
*/
3131

32-
use In2code\In2publishCore\Command\Status\Exception\InvalidPageIdArgumentTypeException;
32+
use In2code\In2publishCore\Command\Foreign\Status\Exception\InvalidPageIdArgumentTypeException;
3333
use Symfony\Component\Console\Command\Command;
3434
use Symfony\Component\Console\Input\InputArgument;
3535
use Symfony\Component\Console\Input\InputInterface;

Classes/Command/Status/Typo3VersionCommand.php renamed to Classes/Command/Foreign/Status/Typo3VersionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Status/VersionCommand.php renamed to Classes/Command/Foreign/Status/VersionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Status;
5+
namespace In2code\In2publishCore\Command\Foreign\Status;
66

77
/*
88
* Copyright notice

Classes/Command/Table/BackupCommand.php renamed to Classes/Command/Local/Table/BackupCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Table;
5+
namespace In2code\In2publishCore\Command\Local\Table;
66

77
/*
88
* Copyright notice

Classes/Command/Table/ImportCommand.php renamed to Classes/Command/Local/Table/ImportCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Table;
5+
namespace In2code\In2publishCore\Command\Local\Table;
66

77
/*
88
* Copyright notice

Classes/Command/Table/PublishCommand.php renamed to Classes/Command/Local/Table/PublishCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Command\Table;
5+
namespace In2code\In2publishCore\Command\Local\Table;
66

77
/*
88
* Copyright notice

Classes/Communication/RemoteProcedureCall/EnvelopeDispatcher.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ protected function getPublicUrl(array $request): ?string
334334
$driver = $this->getStorageDriver($storage);
335335
$identifier = $request['identifier'];
336336
$file = $this->getFileObject($driver, $identifier, $storage);
337+
if (null === $file) {
338+
return null;
339+
}
337340
return $storage->getPublicUrl($file);
338341
}
339342

@@ -385,15 +388,15 @@ protected function getStorageDriver(ResourceStorage $storage): DriverInterface
385388
}
386389

387390
/**
388-
* @param $driver
389-
* @param $identifier
390-
* @param $storage
391+
* @param DriverInterface $driver
392+
* @param string $identifier
393+
* @param ResourceStorage $storage
391394
*
392-
* @return File|null|object
395+
* @return File|null
393396
*
394397
* @SuppressWarnings(PHPMD.StaticAccess)
395398
*/
396-
protected function getFileObject($driver, $identifier, $storage)
399+
protected function getFileObject(DriverInterface $driver, string $identifier, ResourceStorage $storage): ?File
397400
{
398401
$fileIndexFactory = GeneralUtility::makeInstance(FileIndexFactory::class, $driver, $driver);
399402

Classes/Communication/RemoteProcedureCall/Letterbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function sendEnvelope(Envelope $envelope)
8787
'Failed to send envelope [' . $uid . ']',
8888
['envelope' => $envelope->toArray(), 'exception' => $exception]
8989
);
90-
throw new $exception;
90+
throw $exception;
9191
}
9292
}
9393

Classes/Component/PostPublishTaskExecution/Command/RunTasksInQueueCommand.php renamed to Classes/Component/PostPublishTaskExecution/Command/Foreign/RunTasksInQueueCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace In2code\In2publishCore\Component\PostPublishTaskExecution\Command;
5+
namespace In2code\In2publishCore\Component\PostPublishTaskExecution\Command\Foreign;
66

77
/*
88
* Copyright notice
@@ -29,7 +29,6 @@
2929
* This copyright notice MUST APPEAR in all copies of the script!
3030
*/
3131

32-
use In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Model\Task\AbstractTask;
3332
use In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Repository\TaskRepository;
3433
use In2code\In2publishCore\Service\Context\ContextService;
3534
use Symfony\Component\Console\Command\Command;
@@ -66,7 +65,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6665
$result = [];
6766
// Tasks which should get executed do not have an execution begin
6867
$tasksToExecute = $this->taskRepository->findByExecutionBegin();
69-
/** @var \In2code\In2publishCore\Component\PostPublishTaskExecution\Model\Task\AbstractTask $task */
7068
foreach ($tasksToExecute as $task) {
7169
try {
7270
$success = $task->execute();

Classes/Component/PostPublishTaskExecution/Domain/Repository/TaskRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ protected function taskToPropertiesArray(AbstractTask $task): array
117117
*
118118
* @param DateTime|null $executionBegin
119119
*
120-
* @return array|NULL
120+
* @return AbstractTask[]
121121
*/
122-
public function findByExecutionBegin(DateTime $executionBegin = null): ?array
122+
public function findByExecutionBegin(DateTime $executionBegin = null): array
123123
{
124124
$query = $this->connection->createQueryBuilder();
125125
$query->getRestrictions()->removeAll();

Classes/Component/PostPublishTaskExecution/Service/TaskExecutionService.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
use In2code\In2publishCore\Communication\RemoteCommandExecution\RemoteCommandDispatcher;
3333
use In2code\In2publishCore\Communication\RemoteCommandExecution\RemoteCommandRequest;
3434
use In2code\In2publishCore\Communication\RemoteCommandExecution\RemoteCommandResponse;
35-
use In2code\In2publishCore\Component\PostPublishTaskExecution\Command\RunTasksInQueueCommand;
35+
use In2code\In2publishCore\Component\PostPublishTaskExecution\Command\Foreign\RunTasksInQueueCommand;
3636
use In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Repository\TaskRepository;
37+
use In2code\In2publishCore\Event\TaskExecutionWasFinished;
3738
use Psr\Log\LoggerAwareInterface;
3839
use Psr\Log\LoggerAwareTrait;
40+
use TYPO3\CMS\Core\EventDispatcher\EventDispatcher;
3941

4042
class TaskExecutionService implements LoggerAwareInterface
4143
{
@@ -47,10 +49,17 @@ class TaskExecutionService implements LoggerAwareInterface
4749
/** @var TaskRepository */
4850
protected $taskRepository;
4951

50-
public function __construct(RemoteCommandDispatcher $remoteCommandDispatcher, TaskRepository $taskRepository)
51-
{
52+
/** @var EventDispatcher */
53+
private $eventDispatcher;
54+
55+
public function __construct(
56+
RemoteCommandDispatcher $remoteCommandDispatcher,
57+
TaskRepository $taskRepository,
58+
EventDispatcher $eventDispatcher
59+
) {
5260
$this->remoteCommandDispatcher = $remoteCommandDispatcher;
5361
$this->taskRepository = $taskRepository;
62+
$this->eventDispatcher = $eventDispatcher;
5463
}
5564

5665
public function runTasks(): RemoteCommandResponse
@@ -60,6 +69,8 @@ public function runTasks(): RemoteCommandResponse
6069

6170
$this->taskRepository->deleteObsolete();
6271

72+
$this->eventDispatcher->dispatch(new TaskExecutionWasFinished($response));
73+
6374
if ($response->isSuccessful()) {
6475
$this->logger->info('Task execution results', ['output' => $response->getOutput()]);
6576
} else {

Classes/Component/RecordHandling/DefaultRecordFinder.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ class DefaultRecordFinder extends CommonRepository implements RecordFinder, Logg
169169
protected $tcaProcessingService;
170170

171171
public function __construct(
172-
?Connection $localDatabase,
173-
?Connection $foreignDatabase,
172+
Connection $localDatabase,
173+
Connection $foreignDatabase,
174174
RecordFactory $recordFactory,
175175
ResourceFactory $resourceFactory,
176176
ConfigContainer $configContainer,
@@ -1697,12 +1697,11 @@ protected function fetchRelatedRecordsByInlineMm(
16971697
!empty($columnConfiguration['foreign_field'])
16981698
|| !empty($columnConfiguration['foreign_selector'])
16991699
|| !empty($columnConfiguration['filter'])
1700-
|| !empty($columnConfiguration['foreign_types'])
17011700
|| !empty($columnConfiguration['foreign_table_field'])
17021701
) {
17031702
$this->logger->error(
1704-
'Inline MM relations with foreign_field, foreign_types, symmetric_field, filter, '
1705-
. 'foreign_table_field or foreign_selector are not supported',
1703+
'Inline MM relations with foreign_field, foreign_selector,'
1704+
. ' filter, or foreign_table_field are not supported',
17061705
[
17071706
'columnConfiguration' => $columnConfiguration,
17081707
'recordTableName' => $recordTableName,

Classes/Component/RecordHandling/DefaultRecordPublisher.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class DefaultRecordPublisher extends CommonRepository implements RecordPublisher
6464
/** @var TcaService */
6565
protected $tcaService;
6666

67+
/** @var array */
68+
private $visitedRecords = [];
69+
6770
public function __construct(EventDispatcher $eventDispatcher, Connection $foreignDatabase, TcaService $tcaService)
6871
{
6972
$this->eventDispatcher = $eventDispatcher;

0 commit comments

Comments
 (0)