Skip to content

Commit e2de2a9

Browse files
committed
[RELEASE] Version 11.0.4
Resolves: https://projekte.in2code.de/issues/53575
2 parents 6c5b9cf + 7be2020 commit e2de2a9

File tree

12 files changed

+95
-51
lines changed

12 files changed

+95
-51
lines changed

.gitattributes

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# .gitattributes
22

3-
Build export-ignore
3+
/.github export-ignore
4+
/.project export-ignore
5+
/Build export-ignore
46
.gitkeep export-ignore
57
/.editorconfig export-ignore
68
/.gitattributes export-ignore
79
/.gitignore export-ignore
810
/.eslintrc export-ignore
911
/.travis.yml export-ignore
10-
/phpunit.xml.dist export-ignore
11-
/Tests export-ignore
1212
/Resources/Private/Sass export-ignore
1313
/Resources/Private/config.rb export-ignore
1414
/Resources/Private/Clickdummy export-ignore
15+
/Tests export-ignore
16+
/Makefile export-ignore
17+
/phive.xml export-ignore
1518

1619
# Handle line endings automatically for files detected as text
1720
# and leave all files detected as binary untouched.

Build/UnitTests.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<phpunit
22
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
44
backupGlobals="true"
55
bootstrap="UnitTestsBootstrap.php"
66
colors="true"
@@ -22,6 +22,11 @@
2222
<directory>../Tests/Unit/</directory>
2323
</testsuite>
2424
</testsuites>
25+
<coverage>
26+
<include>
27+
<directory suffix=".php">../Classes</directory>
28+
</include>
29+
</coverage>
2530
<php>
2631
<const name="TYPO3_MODE" value="BE" />
2732
<ini name="display_errors" value="1" />

CHANGELOG.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,30 @@
11
# In2publish Core Change Log
22

3+
11.0.4:
4+
- **Everything included in the 10.2.5 release**
5+
- [META] Set the EM conf version number to 11.0.4
6+
- [DOCS] Update changelog
7+
- [TESTS] Configure Code Coverage and add missing coversDefaultClass
8+
- [META] Mark as compatible with PHP 8.1
9+
- [RELEASE] Version 11.0.3 with bug fixes
10+
311
11.0.3:
412

13+
- **Everything included in the 10.2.4 release**
514
- [META] Set the EM conf version number to 11.0.3
615
- [CLEANUP] Remove useless parentheses
716
- [QA] Update QA tools
817
- [BUGFIX] Set the correct return type for FileController::getRecordToPublish
918
- [COMMENT] Update rFALd::getFoldersInFolder return annotation
1019
- [BUGFIX] Call the correct (renamed) method rebuildAll for TYPO3 v11
11-
- [COMMENT] Update the return annotation of findRedirectsByDynamicTarget
12-
- [BUGFIX] Ensure the rowCount is always an integer
13-
- [BUGFIX] Don't try to bulkInsert an empty data set
1420
- [REFACTOR] Reduce cyclomatic and npath complexity
1521
- [QA] Force installation of unsigned phars (like phpmd) and add all phars to PATH
1622
- [TESTS] Remove duplicate import of RuntimeException
1723
- [TESTS] Remove duplicate import of Testbase
18-
- [BUGFIX] Prevent infinite recursion when collecting records that are going to be published
19-
- [BUGFIX] Remove the HostNameValidator
20-
- [BUGFIX] Override database state if sys_file records have been changed
21-
- [BUGFIX] Early fail the UniqueStorageTargetTest when EXT:scheduler is not installed
22-
- [BUGFIX] Remove duplicate line which should have been removed
23-
- [BUGFIX] Prevent undefined array key access in DatabaseUtility
2424
- [BUGFIX] Set correct flash message severity when file publishing fails and show collected failures
2525
- [DOCS] Add UPGRADING for v10 to v11 and some publish files module screenshots
26-
- [TASK] Fix TestLabelLocalizer error
2726
- [BUGFIX] Add missing slash in combined folder identifier
28-
- [BUGFIX] Allow input fields with renderType inputLink
29-
- [BUGFIX] Do not exclude columns which have an itemsProcFunc
30-
- [BUGFIX] Do not ignore MM-records to excluded tables
31-
- [BUGFIX] Use the group MM tablenames field instead of true/false
32-
- [BUGFIX] Fix type error in FileEdgeCacheInvalidationService class
33-
- [BUGFIX] Fallback to the foreignUid if localUid is null
34-
- [BUGFIX] Add conditions to not break resetting backend user preferences
35-
- [BUGFIX] Update the list of required tables
3627
- [BUGFIX] Fetch all RPC rows instead of just the first
37-
- [BUGFIX] Allow envelopes to grow arbitrarily huge
38-
- [TESTS] Add missing ticket annotations for command tests
39-
- [TESTS] Add functional test to assert that MM records can be marked as publishing
40-
- [BUGFIX] Allow MM records to be marked as running
41-
- [BUGFIX] Make RunTasksInQueueCommand compatible with symfony/console 4.4 and add test
42-
- [TESTS] Fix tests for different dbal and TYPO3 versions
43-
- [TESTS] Mock Result class which exists in composerMinInstall
44-
- [TESTS] Fix DbConfigTestCommandTest, remove BackupCommandTest
45-
- [BUGFIX] Ensure all (testable) commands are executable
4628

4729
11.0.2:
4830

@@ -180,6 +162,24 @@
180162
- [CLEANUP] Remove outdated compatibility class SignalSlotReplacement
181163
- [!!!][UPDATE] Require TYPO3 v11
182164

165+
10.2.6:
166+
- [META] Set the EM conf version number to 10.2.6
167+
- [BUGFIX] Use correct key "foreign" to index a row from Foreign
168+
- [BUGFIX] Support resolving related redirects with query URL parts
169+
- [BUGFIX] Show undecoded message line if it could not be decoded
170+
- [BUGFIX] Throw an exception if the file to retrieve does not exist
171+
- [BUGFIX] Do not try to publish files that neither exist on local nor foreign
172+
- [RELEASE] Version 10.2.5 with non-empty bulk inserts
173+
174+
10.2.5:
175+
176+
- [META] Set the EM conf version number to 10.2.5
177+
- [GIT] Ignore the .github folder when creating a production dist
178+
- [COMMENT] Update the return annotation of findRedirectsByDynamicTarget
179+
- [BUGFIX] Ensure the rowCount is always an integer
180+
- [BUGFIX] Don't try to bulkInsert an empty data set
181+
- [RELEASE] Version 10.2.4 with bug fixes
182+
183183
10.2.4:
184184

185185
- [META] Set the EM conf version number to 10.2.4

Classes/Component/FalHandling/Finder/Factory/FileIndexFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ public function updateFileIndexInfo(
140140
$record->setLocalProperties($localFileInfo);
141141
$record->setForeignProperties($foreignFileInfo);
142142
$record->setDirtyProperties()->calculateState();
143+
} else {
144+
$record->addAdditionalProperty('fileState', 'missing');
143145
}
144146
}
145147

Classes/Domain/Service/Publishing/FilePublisherService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ protected function transferTemporaryFile(int $storage, string $fileIdentifier):
145145
protected function getLocalReadableFilePathForIdentifier(int $storage, string $fileIdentifier): string
146146
{
147147
$resourceStorage = $this->resourceFactory->getStorageObject($storage);
148+
if (!$resourceStorage->hasFile($fileIdentifier)) {
149+
throw new FileMissingException($fileIdentifier);
150+
}
148151
return $resourceStorage->getFile($fileIdentifier)->getForLocalProcessing(false);
149152
}
150153
}

Classes/Features/PhysicalFilePublisher/Domain/Anomaly/PhysicalFilePublisher.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ protected function publishAuthoritativeRecord(
127127
string $identifier,
128128
string $combinedIdentifier
129129
): void {
130+
if ($record->getAdditionalProperty('fileState') === 'missing') {
131+
return;
132+
}
130133
switch ($record->getState()) {
131134
case RecordInterface::RECORD_STATE_MOVED_AND_CHANGED:
132135
$result = $this->replaceFileWithChangedCopy($record, $storage, $logData);

Classes/Features/RedirectsSupport/Domain/Repository/SysRedirectRepository.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@
3434
use TYPO3\CMS\Core\Database\Connection;
3535
use TYPO3\CMS\Core\Database\ConnectionPool;
3636
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
37+
use TYPO3\CMS\Core\Http\Uri;
3738
use TYPO3\CMS\Core\Utility\GeneralUtility;
3839
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
3940
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
4041
use TYPO3\CMS\Extbase\Persistence\Repository;
4142

4243
class SysRedirectRepository extends Repository
4344
{
45+
/**
46+
* @param array<Uri> $uris
47+
*/
4448
public function findRawByUris(Connection $connection, array $uris, array $exceptUid): array
4549
{
4650
$query = $connection->createQueryBuilder();
@@ -49,14 +53,19 @@ public function findRawByUris(Connection $connection, array $uris, array $except
4953
$predicates = [];
5054

5155
foreach ($uris as $uri) {
56+
$target = $uri->getPath();
57+
$queryPart = $uri->getQuery();
58+
if (!empty($queryPart)) {
59+
$target .= '?' . $queryPart;
60+
}
5261
if ($uri->getHost() === '*') {
5362
// If the "parent" redirect does not have a host it does not matter which host the redirect has, which
5463
// redirects to the host-less redirect. It just belongs.
55-
$predicates[] = $query->expr()->eq('target', $query->createNamedParameter($uri->getPath()));
64+
$predicates[] = $query->expr()->eq('target', $query->createNamedParameter($target));
5665
} else {
5766
/** @psalm-suppress ImplicitToStringCast */
5867
$predicates[] = $query->expr()->andX(
59-
$query->expr()->eq('target', $query->createNamedParameter($uri->getPath())),
68+
$query->expr()->eq('target', $query->createNamedParameter($target)),
6069
$query->expr()->orX(
6170
$query->expr()->eq('source_host', $query->createNamedParameter($uri->getHost())),
6271
$query->expr()->eq('source_host', $query->createNamedParameter('*'))

Classes/Features/RedirectsSupport/PageRecordRedirectEnhancer.php

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ protected function findRedirectsByDynamicTarget(RecordInterface $record): array
138138
return $collected;
139139
}
140140

141+
/**
142+
* @param array<Uri> $uris
143+
* @param array<int, array{local?: array, foreign?: array}> $collected
144+
*/
141145
protected function collectRedirectsByUri(array $uris, array $collected, string $side, Connection $connection): array
142146
{
143147
$newRows = $this->repo->findRawByUris($connection, $uris, array_keys($collected));
@@ -149,9 +153,7 @@ protected function collectRedirectsByUri(array $uris, array $collected, string $
149153
$newUris = [];
150154
foreach ($newRows as $row) {
151155
$collected[$row['uid']][$side] = $row;
152-
$newUris[$row['uid']] = (new Uri())
153-
->withHost($row['source_host'] ?? '')
154-
->withPath($row['source_path'] ?? '');
156+
$newUris[$row['uid']] = $this->rowToUri($row);
155157
}
156158

157159
return $this->collectRedirectsByUri($newUris, $collected, $side, $connection);
@@ -191,6 +193,7 @@ protected function assignRedirects(Connection $connection, array $uids, int $pid
191193
}
192194

193195
/**
196+
* @param array<int, array{local?: array, foreign?: array}> $redirects
194197
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
195198
*/
196199
protected function findMissingRowsByUid(array $redirects): array
@@ -232,14 +235,10 @@ protected function findRedirectsByUri(RecordInterface $record): array
232235
$redirects = $this->getExistingRedirects($record);
233236
foreach ($redirects as $redirect) {
234237
if (!empty($redirect['local'])) {
235-
$row = $redirect['local'];
236-
$basicUris[] = (new Uri())->withHost($row['source_host'] ?? '')
237-
->withPath($row['source_path'] ?? '');
238+
$basicUris[] = $this->rowToUri($redirect['local']);
238239
}
239240
if (!empty($redirect['foreign'])) {
240-
$row = $redirect['foreign'];
241-
$basicUris[] = (new Uri())->withHost($row['source_host'] ?? '')
242-
->withPath($row['source_path'] ?? '');
241+
$basicUris[] = $this->rowToUri($redirect['foreign']);
243242
}
244243
}
245244

@@ -295,9 +294,7 @@ protected function createAndAddRecordsToRecord(RecordInterface $record, array $r
295294
}
296295

297296
/**
298-
* @return array[][]
299-
*
300-
* @psalm-return array<int|string, array{local?: array}>
297+
* @return array<int, array{local?: array, foreign?: array}>
301298
*/
302299
protected function getExistingRedirects(RecordInterface $record): array
303300
{
@@ -309,10 +306,24 @@ protected function getExistingRedirects(RecordInterface $record): array
309306
$row['local'] = $redirectRecord->getLocalProperties();
310307
}
311308
if ($redirectRecord->foreignRecordExists()) {
312-
$row['local'] = $redirectRecord->getForeignProperties();
309+
$row['foreign'] = $redirectRecord->getForeignProperties();
313310
}
314311
$redirects[$redirectRecord->getIdentifier()] = $row;
315312
}
316313
return $redirects;
317314
}
315+
316+
/**
317+
* @param array{source_path?: string, source_host?: string} $row
318+
* @noinspection PhpRedundantDocCommentInspection
319+
* @noinspection RedundantSuppression
320+
*/
321+
protected function rowToUri(array $row): Uri
322+
{
323+
$uri = new Uri($row['source_path'] ?? '');
324+
if (!empty($row['source_host'])) {
325+
$uri = $uri->withHost($row['source_host']);
326+
}
327+
return $uri;
328+
}
318329
}

Classes/Features/SystemInformationExport/Exporter/LogsExporter.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
* This copyright notice MUST APPEAR in all copies of the script!
3030
*/
3131

32+
use JsonException;
3233
use TYPO3\CMS\Core\Database\ConnectionPool;
3334

3435
use function json_decode;
3536
use function sprintf;
3637
use function strftime;
3738
use function substr;
3839

40+
use const JSON_THROW_ON_ERROR;
41+
3942
class LogsExporter implements SystemInformationExporter
4043
{
4144
protected ConnectionPool $connectionPool;
@@ -72,7 +75,11 @@ public function getInformation(): array
7275
);
7376
$logData = $log['data'];
7477
$logDataJson = substr($logData, 2);
75-
$logsFormatted[$message] = json_decode($logDataJson, true, 512, JSON_THROW_ON_ERROR);
78+
try {
79+
$logsFormatted[$message] = json_decode($logDataJson, true, 512, JSON_THROW_ON_ERROR);
80+
} catch (JsonException $e) {
81+
$logsFormatted[$message] = $logData;
82+
}
7683
}
7784
return $logsFormatted;
7885
}

Tests/Unit/Domain/Model/RecordTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
/**
1616
* @SuppressWarnings(PHPMD)
17+
* @coversDefaultClass \In2code\In2publishCore\Domain\Model\Record
1718
*/
1819
class RecordTest extends UnitTestCase
1920
{
@@ -737,7 +738,7 @@ public function testParentRecordCanBeSetAgainAfterParentRecordWasUnlocked()
737738

738739
/**
739740
* @covers ::getBreadcrumb
740-
* @covers ::getRecordPath
741+
* @covers ::getParentRecord
741742
* @depends testSetParentRecordSetsParentRecord
742743
*/
743744
public function testGetBreadcrumbReturnsSlashImplodedStringToRootRecord()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "typo3-cms-extension",
1111
"license": "GPL-3.0-or-later",
1212
"require": {
13-
"php": "^7.4 || ^8.0 <8.1",
13+
"php": "^7.4 || ^8.0",
1414
"ext-json": "*",
1515
"ext-pdo": "*",
1616
"ext-zip": "*",

ext_emconf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
'title' => 'in2publish Core',
1010
'description' => 'Content publishing extension to connect stage and production server',
1111
'category' => 'plugin',
12-
'version' => '11.0.3',
12+
'version' => '11.0.4',
1313
'state' => 'stable',
1414
'clearCacheOnLoad' => true,
1515
'author' => 'Alex Kellner, Oliver Eglseder, Thomas Scheibitz, Stefan Busemann',
1616
'author_email' => '[email protected]',
1717
'author_company' => 'in2code.de',
1818
'constraints' => [
1919
'depends' => [
20-
'php' => '7.4.0-8.0.99',
20+
'php' => '7.4.0-8.99.99',
2121
'typo3' => '11.5.0-11.99.99',
2222
],
2323
'conflicts' => [],

0 commit comments

Comments
 (0)