Skip to content

Commit a2859dc

Browse files
committed
2 parents bf72e11 + d0058ac commit a2859dc

File tree

59 files changed

+886
-106
lines changed

Some content is hidden

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

59 files changed

+886
-106
lines changed

CHANGELOG.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,54 @@
11
# In2publish Core Change Log
22

3+
9.5.0:
4+
5+
- [META] Set the branch alias version number to 9.5.x-dev
6+
- [META] Set the EM conf version number to 9.5.0
7+
- [CLEANUP] Remove superfluous empty lines and add ones where appropriate
8+
- [CLEANUP] Remove unused imports and superfluous lines in import sections
9+
- [BUGFIX] Always create the additional redirects fields if the extension is installed
10+
- [BUGFIX] Allow null as return value in FalIndexPostProcessor::getStorage
11+
- [BUGFIX] Register the RedirectsSupport SQL slot in all TYPO3 modes
12+
- [BUGFIX] Use the deprecated Connection::fetchAll for TYPO3 v9 compatibility
13+
- [FEATURE] Include the sites config in the sysinfo export
14+
- [FEATURE] Respect rootLevel, allowedTables and skip empty tables or missing PIDs
15+
- [BUGFIX] Respect TCA rootLevel and PAGES_TYPES allowedTables when searching for related records by PID
16+
- [FEATURE] Move the rootLevel decision to the TcaService, merge all SkipTableVoters
17+
- [FEATURE] Create SkipRootLevelVoter to skip searching for records in tables not allowed on that page
18+
- [FEATURE] Lazy register SkipTableByPidVoter, lazy init tables
19+
- [FEATURE] Add Signal to skip searching for records by pid if no such PID exists
20+
- [BUGFIX] Skip post processing of sys_file records which do not exist
21+
- [BUGFIX] Return the DatabaseFields slot arguments as array
22+
- [BUGFIX] Add SQL and TCA for sys_redirects only when EXT:redirects is loaded
23+
- [CODESTYLE] Add empty line before multi-line condition
24+
- [BUGFIX] Add missing return type hints commands
25+
- [FEATURE] Lazily inspect if tables are empty, log query stats
26+
- [FEATURE] Lazy register the SkipTableVoter and use an object instead of class name
27+
- [BUGFIX] Remove spamming debug logger
28+
- [REFACTOR] Use a single method to set the rows index
29+
- [FEATURE] Add a SkipTableVoter to skip querying empty tables
30+
- [BUGFIX] Try to get a cached record when searching by an identifier
31+
- [CLEANUP] Remove useless logging of relation recursion
32+
- [CODESTYLE] Remove blank line between import groups in BaseRepo
33+
- [BUGFIX] Use eq() instead of like() for int values (fixes #84 closes #85)
34+
- [BUGFIX] Set the parent record of translated records
35+
- [FEATURE] Add feature "publishSorting" to publish the sortings of all affected records
36+
- [REFACTOR] Simplify the sorting collecting and publishing
37+
- [CODESTYLE] Indent the config definer on the "chop level"
38+
- [BUGFIX] Respect the publishSorting enable setting
39+
- [CODESTYLE] Reformat code
40+
- [REFACTOR] Get name of sorting field from tca
41+
- [REFACTOR] Add return type hints
42+
- [CLEANUP] Remove unused use statements and initialization of variables
43+
- [CLEANUP] Remove unused variable
44+
- [BUGFIX] Fix field name for enable field in PublishSortingDefiner
45+
- [COMMENT] Adjust comments
46+
- [BUGFIX] Remove static pid used for testing
47+
- [TASK] Enable publishing of changes on sorting
48+
- [BUGFIX] Removed duplicate file name (closes #83)
49+
- [RELEASE] Version 9.4.0 with redirects support
50+
51+
352
9.4.0:
453

554
- [META] Set the branch alias version number to 9.4.x-dev
@@ -455,7 +504,6 @@
455504
- [BUGFIX] Remove type hint and add null type to the return annotation of CommonRepository::findByIdentifierInOtherTable
456505
- [RELEASE] Version 8.0.3 with TCA user error prevention, CLI dispatching fix and T3URN parsing enhancement
457506

458-
459507
8.0.3:
460508

461509
- [META] Set the EM conf version number to 8.0.3
@@ -1217,6 +1265,7 @@
12171265
- [TASK] Declare non-public API commands as internal
12181266

12191267
5.0.0:
1268+
12201269
- [RELEASE] Release in2publish_core alpha 1
12211270
- [TASK] Remove surplus features
12221271

Classes/Command/PublishTaskRunner/RunTasksInQueueCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function isEnabled()
6060
return GeneralUtility::makeInstance(ContextService::class)->isForeign();
6161
}
6262

63-
protected function execute(InputInterface $input, OutputInterface $output)
63+
protected function execute(InputInterface $input, OutputInterface $output): int
6464
{
6565
$taskRepository = GeneralUtility::makeInstance(TaskRepository::class);
6666
$result = [];

Classes/Command/RemoteProcedureCall/ExecuteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function isEnabled()
6262
return GeneralUtility::makeInstance(ContextService::class)->isForeign();
6363
}
6464

65-
protected function execute(InputInterface $input, OutputInterface $output)
65+
protected function execute(InputInterface $input, OutputInterface $output): int
6666
{
6767
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
6868

Classes/Command/Status/AllCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure()
4646
->setHidden(true);
4747
}
4848

49-
protected function execute(InputInterface $input, OutputInterface $output)
49+
protected function execute(InputInterface $input, OutputInterface $output): int
5050
{
5151
$commandRegistry = GeneralUtility::makeInstance(CommandRegistry::class);
5252
$commandRegistry->getCommandByIdentifier(VersionCommand::IDENTIFIER)->execute($input, $output);

Classes/Command/Status/ConfigFormatTestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function configure()
5050
->setHidden(true);
5151
}
5252

53-
protected function execute(InputInterface $input, OutputInterface $output)
53+
protected function execute(InputInterface $input, OutputInterface $output): int
5454
{
5555
$container = GeneralUtility::makeInstance(ValidationContainer::class);
5656
$configContainer = GeneralUtility::makeInstance(ConfigContainer::class);

Classes/Command/Status/CreateMasksCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function configure()
4444
->setHidden(true);
4545
}
4646

47-
protected function execute(InputInterface $input, OutputInterface $output)
47+
protected function execute(InputInterface $input, OutputInterface $output): int
4848
{
4949
$output->writeln('FileCreateMask: ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask']);
5050
$output->writeln('FolderCreateMask: ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask']);

Classes/Command/Status/DbConfigTestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function configure()
4949
->setHidden(true);
5050
}
5151

52-
protected function execute(InputInterface $input, OutputInterface $output)
52+
protected function execute(InputInterface $input, OutputInterface $output): int
5353
{
5454
$queryBuilder = DatabaseUtility::buildLocalDatabaseConnection()->createQueryBuilder();
5555
$predicates = $queryBuilder->expr()->eq(

Classes/Command/Status/DbInitQueryEncodedCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function configure()
4747
->setHidden(true);
4848
}
4949

50-
protected function execute(InputInterface $input, OutputInterface $output)
50+
protected function execute(InputInterface $input, OutputInterface $output): int
5151
{
5252
$dbInit = '';
5353
if (!empty($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['initCommands'])) {

Classes/Command/Status/EncryptionKeyCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure()
4646
->setHidden(true);
4747
}
4848

49-
protected function execute(InputInterface $input, OutputInterface $output)
49+
protected function execute(InputInterface $input, OutputInterface $output): int
5050
{
5151
$output->writeln('EKey: ' . base64_encode($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']));
5252
return 0;

Classes/Command/Status/GlobalConfigurationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function configure()
4444
->setHidden(true);
4545
}
4646

47-
protected function execute(InputInterface $input, OutputInterface $output)
47+
protected function execute(InputInterface $input, OutputInterface $output): int
4848
{
4949
$utf8fileSystem = empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'])
5050
? 'empty'

Classes/Command/Status/ShortSiteConfigurationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function configure()
4949
->setHidden(true);
5050
}
5151

52-
protected function execute(InputInterface $input, OutputInterface $output)
52+
protected function execute(InputInterface $input, OutputInterface $output): int
5353
{
5454
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
5555
$shortInfo = [];

Classes/Command/Status/SiteConfigurationCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
3939
use TYPO3\CMS\Core\Site\SiteFinder;
4040
use TYPO3\CMS\Core\Utility\GeneralUtility;
41-
4241
use TYPO3\CMS\Core\Utility\RootlineUtility;
4342

4443
use function base64_encode;

Classes/Command/Status/Typo3VersionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure()
4646
->setHidden(true);
4747
}
4848

49-
protected function execute(InputInterface $input, OutputInterface $output)
49+
protected function execute(InputInterface $input, OutputInterface $output): int
5050
{
5151
$output->writeln('TYPO3: ' . TYPO3_version);
5252
return 0;

Classes/Command/Status/VersionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function configure()
4545
->setHidden(true);
4646
}
4747

48-
protected function execute(InputInterface $input, OutputInterface $output)
48+
protected function execute(InputInterface $input, OutputInterface $output): int
4949
{
5050
$output->writeln('Version: ' . ExtensionUtility::getExtensionVersion('in2publish_core'));
5151
return 0;

Classes/Command/Table/BackupCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function configure()
2525
->addArgument(self::ARG_TABLE_NAME, InputArgument::REQUIRED, self::ARG_TABLE_NAME_DESCRIPTION);
2626
}
2727

28-
protected function execute(InputInterface $input, OutputInterface $output)
28+
protected function execute(InputInterface $input, OutputInterface $output): int
2929
{
3030
$tableName = $input->getArgument(self::ARG_TABLE_NAME);
3131
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);

Classes/Command/Table/ImportCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function isEnabled()
3737
return GeneralUtility::makeInstance(ContextService::class)->isLocal();
3838
}
3939

40-
protected function execute(InputInterface $input, OutputInterface $output)
40+
protected function execute(InputInterface $input, OutputInterface $output): int
4141
{
4242
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
4343
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);

Classes/Command/Table/PublishCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function isEnabled()
4141
return GeneralUtility::makeInstance(ContextService::class)->isLocal();
4242
}
4343

44-
protected function execute(InputInterface $input, OutputInterface $output)
44+
protected function execute(InputInterface $input, OutputInterface $output): int
4545
{
4646
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
4747
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);

Classes/Command/Tools/TestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function isEnabled()
3737
return GeneralUtility::makeInstance(ContextService::class)->isLocal();
3838
}
3939

40-
protected function execute(InputInterface $input, OutputInterface $output)
40+
protected function execute(InputInterface $input, OutputInterface $output): int
4141
{
4242
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
4343
$testingService = GeneralUtility::makeInstance(TestingService::class);

Classes/Controller/FileController.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
use In2code\In2publishCore\Domain\Model\RecordInterface;
3737
use In2code\In2publishCore\Domain\Repository\CommonRepository;
3838
use In2code\In2publishCore\Domain\Service\Publishing\FolderPublisherService;
39-
use In2code\In2publishCore\Utility\DatabaseUtility;
4039
use RuntimeException;
4140
use Throwable;
4241
use TYPO3\CMS\Core\Messaging\AbstractMessage;
@@ -48,9 +47,7 @@
4847
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotReturnException;
4948
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
5049

51-
use function array_key_exists;
5250
use function count;
53-
use function in_array;
5451
use function strpos;
5552

5653
/**

Classes/Controller/ToolsController.php

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,22 @@
3434
use In2code\In2publishCore\Communication\RemoteProcedureCall\Letterbox;
3535
use In2code\In2publishCore\Config\ConfigContainer;
3636
use In2code\In2publishCore\Config\PostProcessor\DynamicValueProvider\DynamicValueProviderRegistry;
37+
use In2code\In2publishCore\Domain\Service\ForeignSiteFinder;
3738
use In2code\In2publishCore\Domain\Service\TcaProcessingService;
3839
use In2code\In2publishCore\In2publishCoreException;
3940
use In2code\In2publishCore\Service\Environment\EnvironmentService;
4041
use In2code\In2publishCore\Testing\Service\TestingService;
4142
use In2code\In2publishCore\Testing\Tests\TestResult;
4243
use In2code\In2publishCore\Tools\ToolsRegistry;
4344
use In2code\In2publishCore\Utility\DatabaseUtility;
44-
use ReflectionProperty;
4545
use Throwable;
4646
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
4747
use TYPO3\CMS\Core\Core\Environment;
4848
use TYPO3\CMS\Core\Database\ConnectionPool;
4949
use TYPO3\CMS\Core\Messaging\AbstractMessage;
5050
use TYPO3\CMS\Core\Registry;
51+
use TYPO3\CMS\Core\Site\Entity\Site;
52+
use TYPO3\CMS\Core\Site\SiteFinder;
5153
use TYPO3\CMS\Core\Utility\ArrayUtility;
5254
use TYPO3\CMS\Core\Utility\GeneralUtility;
5355
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
@@ -63,8 +65,6 @@
6365
use function defined;
6466
use function file_get_contents;
6567
use function flush;
66-
use function generateUpToDateMimeArray;
67-
use function get_class;
6868
use function gmdate;
6969
use function header;
7070
use function implode;
@@ -451,6 +451,47 @@ protected function getFullInfo(): array
451451

452452
$dynamicProvider = GeneralUtility::makeInstance(DynamicValueProviderRegistry::class)->getRegisteredClasses();
453453

454+
$siteConfigs = [];
455+
456+
$localSites = GeneralUtility::makeInstance(SiteFinder::class)->getAllSites(false);
457+
$foreignSites = GeneralUtility::makeInstance(ForeignSiteFinder::class)->getAllSites();
458+
/**
459+
* @var string $side
460+
* @var Site $site
461+
*/
462+
foreach (['local' => $localSites, 'foreign' => $foreignSites] as $side => $sites) {
463+
foreach ($sites as $site) {
464+
$langs = [];
465+
$rootPageId = $site->getRootPageId();
466+
foreach ($site->getAllLanguages() as $language) {
467+
$languageId = $language->getLanguageId();
468+
try {
469+
$uri = $site->getRouter()->generateUri($rootPageId, ['_language' => $languageId])->__toString();
470+
} catch (Throwable $throwable) {
471+
$uri = (string)$throwable;
472+
}
473+
$langs[] = [
474+
'base' => $language->getBase()->__toString(),
475+
'actualURI' => $uri,
476+
'langId' => $languageId,
477+
'typo3Lang' => $language->getTypo3Language(),
478+
'isocode' => $language->getTwoLetterIsoCode(),
479+
];
480+
}
481+
try {
482+
$uri = $site->getRouter()->generateUri($rootPageId)->__toString();
483+
} catch (Throwable $throwable) {
484+
$uri = (string)$throwable;
485+
}
486+
$siteConfigs[$side][$site->getIdentifier()] = [
487+
'rootPageId' => $rootPageId,
488+
'base' => $site->getBase()->__toString(),
489+
'actualURI' => $uri,
490+
'langs' => $langs,
491+
];
492+
}
493+
}
494+
454495
return [
455496
'TYPO3 Version' => VersionNumberUtility::getCurrentTypo3Version(),
456497
'PHP Version' => PHP_VERSION,
@@ -471,6 +512,7 @@ protected function getFullInfo(): array
471512
'personal config' => $pers,
472513
'TCA' => $GLOBALS['TCA'],
473514
'schema' => $schema,
515+
'sites' => $siteConfigs,
474516
];
475517
}
476518
}

Classes/Domain/Factory/RecordFactory.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,6 @@ protected function isLooping($instanceTableName, $mergedIdentifier): bool
544544
if (!empty($this->instantiationQueue[$instanceTableName])
545545
&& in_array($mergedIdentifier, $this->instantiationQueue[$instanceTableName])
546546
) {
547-
$this->logger->info(
548-
'Recursion detected! This is mostly a sys_file_reference'
549-
. ' pointing to it\'s sys_file, which gets currently enriched',
550-
[
551-
'instanceTableName' => $instanceTableName,
552-
'mergedIdentifier' => $mergedIdentifier,
553-
]
554-
);
555547
return true;
556548
}
557549
if (empty($this->instantiationQueue[$instanceTableName])) {
@@ -665,6 +657,7 @@ protected function findTranslations(RecordInterface $record, CommonRepository $c
665657
$tableName
666658
);
667659
foreach ($translatedRecords as $translatedRecord) {
660+
$translatedRecord->setParentRecord($record);
668661
$record->addTranslatedRecord($translatedRecord);
669662
}
670663
}

Classes/Domain/Model/Record.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
use In2code\In2publishCore\Service\Permission\PermissionService;
3737
use LogicException;
3838
use TYPO3\CMS\Core\Utility\GeneralUtility;
39-
4039
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
4140

4241
use function array_diff;

Classes/Domain/PostProcessing/FalIndexPostProcessor.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ public function __construct()
7979
*/
8080
public function registerInstance(RecordFactory $recordFactory, RecordInterface $instance)
8181
{
82-
if ('sys_file' === $instance->getTableName()) {
82+
if (
83+
'sys_file' === $instance->getTableName()
84+
&& ($instance->localRecordExists() || $instance->foreignRecordExists())
85+
) {
8386
$this->registeredInstances[$instance->getIdentifier()] = $instance;
8487
}
8588
}
@@ -143,7 +146,7 @@ public function postProcess(RecordFactory $recordFactory, RecordInterface $insta
143146
*
144147
* @return ResourceStorage
145148
*/
146-
protected function getStorage(RecordInterface $record): ResourceStorage
149+
protected function getStorage(RecordInterface $record): ?ResourceStorage
147150
{
148151
static $storages = [];
149152
if (!isset($storages[0])) {

Classes/Domain/PostProcessing/FileIndexPostProcessor.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ public function __construct()
7272
*/
7373
public function registerInstance(RecordFactory $recordFactory, RecordInterface $instance)
7474
{
75-
if ('sys_file' === $instance->getTableName()) {
75+
if (
76+
'sys_file' === $instance->getTableName()
77+
&& ($instance->localRecordExists() || $instance->foreignRecordExists())
78+
) {
7679
$this->registeredInstances[] = $instance;
7780
}
7881
}

0 commit comments

Comments
 (0)