Skip to content

Commit 927ff6f

Browse files
committed
2 parents 1f46984 + ed0c1ff commit 927ff6f

File tree

84 files changed

+1483
-462
lines changed

Some content is hidden

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

84 files changed

+1483
-462
lines changed

Build/FunctionalTestsBootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* The TYPO3 project - inspiring people to share!
1616
*/
1717

18+
use TYPO3\TestingFramework\Core\Testbase;
19+
1820
call_user_func(function () {
1921
if (!getenv('IN2PUBLISH_CONTEXT')) {
2022
putenv('IN2PUBLISH_CONTEXT=Local');

Build/UnitTestsBootstrap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@
126126
'boot.state' => $bootState,
127127
]);
128128

129-
$container = $builder->createDependencyInjectionContainer($packageManager, $dependencyInjectionContainerCache, false);
129+
$container = $builder->createDependencyInjectionContainer(
130+
$packageManager,
131+
$dependencyInjectionContainerCache,
132+
false
133+
);
130134

131135
// Push the container to GeneralUtility as we want to make sure its
132136
// makeInstance() method creates classes using the container from now on.

CHANGELOG.md

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

3+
11.0.2:
4+
5+
- **Everything included in the 10.2.3 release**
6+
- [BUGFIX] Modify FAL folder identifier to work with most 3rd party drivers
7+
- [BUGFIX] Replace deprecated FILTER_SANITIZE_STRING option from filter_var with htmlspecialchars
8+
- [BUGFIX] Hide publish file/redirect button if the record is being published
9+
- [BUGFIX] Resolve doctrine/dbal deprecations
10+
- [BUGFIX] Implement missing replacement for SITE markers in TCA
11+
- [REFACTOR] Inject a DB connection in ReplaceMarkersService to get rid of static calls
12+
- [TASK] Apply review feedback
13+
- [BUGFIX] Add missing SiteFinder use statement
14+
- [TASK] Also replace SITE: markers in FlexForms
15+
- [TASK] Add test for replaceSiteMarker functionality
16+
- [BUGFIX] Adjust test cases for ReplaceMarkersService to match new constructor
17+
- [FEATURE] Implement replacement of SITE: markers in TCA
18+
- [RELEASE] Version 11.0.1 with minor bug fixes
19+
320
11.0.1:
421

522
- [META] Set the EM conf version number to 11.0.1
@@ -119,6 +136,54 @@
119136
- [CLEANUP] Remove outdated compatibility class SignalSlotReplacement
120137
- [!!!][UPDATE] Require TYPO3 v11
121138

139+
10.2.3:
140+
141+
- [META] Set the EM conf version number to 10.2.3
142+
- [BUGFIX] Correctly indent other icons in the changed content area
143+
- [CODESTYLE] Fix indent and line length issues
144+
- [DOCS] Add missing Event descriptions, reformat all files
145+
- [CODESTYLE] Fix all CS issues in the Tests folder
146+
- [BUGFIX] Add explanation to the failing TableGarbageCollectorTest result
147+
- [CLEANUP] Remove unnecessary string concatenation from BackendUtilityTest
148+
- [REFACTOR] Replace classes for constant access with the class that defines the constant
149+
- [COMMENT] Add copyright blocks to new RunningRequest classes
150+
- [BUGFIX] Deny publishing of a record that is being published, show the process in the View
151+
- [BUGFIX] Mark all records as being published when bulk-publishing
152+
- [BUGFIX] Write all records recursively to the running requests table
153+
- [BUGFIX] Ensure all links in the publish overview mod in yellow rows are black
154+
- [BUGFIX] Use a static property, because ViewHelper Singletons don't work
155+
- [BUGFIX] Only check for publishing processes running in other processes
156+
- [BUGFIX] Remove condition around garbage collector configuration
157+
- [BUGFIX] Use count instead of select to count scheduler task rowsrows
158+
- [FEATURE] Add RegisterViewHelper to set variables in templates that survive scope popping
159+
- [BUGFIX] Move closing quote to the line it belongs
160+
- [BUGFIX] Show the publish loader if redirects are publishing
161+
- [BUGFIX] Use a random token to identify a request instead of the BE user token
162+
- [BUGFIX] Set Records as not publishable if they are already publishing
163+
- [BUGFIX] Replace publishing finished event with shutdown function
164+
- [BUGFIX] Position the publish link instead of just the icon, show publishing records
165+
- [FEATURE] Add Record::isPublishing to determine if a record is currently being published
166+
- [CODESTYLE] Remove blank lines
167+
- [BUGFIX] Fix label for missing garbage collector task
168+
- [TASK] Add a publish tools test checking the existence of a garbage collector task for table tx_in2publishcore_running_request
169+
- [REFACTOR] Move denial of publishing of running request from record to PublishingRequestIsRunningVoter
170+
- [TASK] Do not show publish button if a request is running for publishing of record
171+
- [BUGFIX] Fallback to the foreign property when identifying files
172+
- [BUGFIX] Support doctrine/dbal < 2.11 again
173+
- [BUGFIX] Replace what used to be fetchOne with fetchColumn
174+
- [BUGFIX] Fix non-existing statement method calls in non-composer mode setups
175+
- [BUGFIX] Fix array keys that are used in PHP 8 when using call_user_func_array
176+
- [BUGFIX] Check if a TCA column MM key is set before accessing it
177+
- [BUGFIX] Respect the actual sortby field from the TCA to detect if records were moved
178+
- [BUGFIX] Skip FlexForm select fields without a foreign table
179+
- [BUGFIX] Check if a key exists in the TCA instead of relying on unset key behavior
180+
- [BUGFIX] Prevent undefined index access in DefaultRecordFinder
181+
- [META] Replace extension/module icons
182+
- [BUGFIX] Always preprend the eventListener for the publishing confirmation
183+
- [BUGFIX] Set start depth to 1 for the SimplifiedOverviewAndPublishing root record
184+
- [BUGFIX] Respect record language when attaching pages to parents
185+
- [RELEASE] Version 10.2.2 with minor bug fixes
186+
122187
10.2.2:
123188

124189
- [META] Set the EM conf version number to 10.2.2

Classes/Communication/RemoteCommandExecution/RemoteCommandResponse.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@
3333

3434
use function array_values;
3535
use function explode;
36-
use function filter_var;
36+
use function htmlspecialchars;
3737
use function implode;
3838
use function is_array;
3939
use function is_string;
4040

41-
use const FILTER_FLAG_NO_ENCODE_QUOTES;
42-
use const FILTER_FLAG_STRIP_HIGH;
43-
use const FILTER_FLAG_STRIP_LOW;
44-
use const FILTER_SANITIZE_STRING;
41+
use const ENT_NOQUOTES;
4542
use const PHP_EOL;
4643

4744
class RemoteCommandResponse
@@ -134,11 +131,7 @@ protected function convertAndSanitizeResponse($response): array
134131
}
135132
$sanitized = [];
136133
foreach ($response as $row => $string) {
137-
$sanitized[$row] = filter_var(
138-
$string,
139-
FILTER_SANITIZE_STRING,
140-
FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_NO_ENCODE_QUOTES
141-
);
134+
$sanitized[$row] = htmlspecialchars($string, ENT_NOQUOTES);
142135
}
143136
return $sanitized;
144137
}

Classes/Component/FalHandling/Finder/DefaultFalFinder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ protected function getFolderInfoByIdentifier(DriverInterface $driver, string $id
497497
{
498498
if ($driver->folderExists($identifier)) {
499499
$info = $driver->getFolderInfoByIdentifier($identifier);
500+
$info['identifier'] = trim($info['identifier'], '/') . '/';
500501
$info['uid'] = sprintf('%d:%s', $info['storage'], $info['identifier']);
501502
} else {
502503
$info = [];
@@ -811,7 +812,7 @@ protected function moveSameSysFileRecordsToRelatedRecords(array $files): array
811812
/** @var RecordInterface[] $fileRecords */
812813
$fileRecords = [];
813814
foreach ($files as $idx => $file) {
814-
$localIdentifier = $file->getLocalProperty('identifier');
815+
$localIdentifier = $file->getLocalProperty('identifier') ?? $file->getForeignProperty('identifier');
815816
if (isset($fileRecords[$localIdentifier])) {
816817
$fileRecords[$localIdentifier]->addRelatedRecord($file);
817818
unset($files[$idx]);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function getFileIndexArray(string $identifier, string $side, int $uid = 0
230230
*/
231231
protected function determineFileType(array $fileInfo): int
232232
{
233-
[$fileType] = explode('/', $fileInfo['mime_type']);
233+
[$fileType] = explode('/', $fileInfo['mime_type'] ?? '');
234234
switch (strtolower($fileType)) {
235235
case 'text':
236236
$type = AbstractFile::FILETYPE_TEXT;

Classes/Component/RecordHandling/DefaultRecordFinder.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,15 @@ protected function convertPropertyArraysToRecords(
450450
}
451451
}
452452
}
453-
if (!$this->isIgnoredRecord((array)$localProperties[$key], (array)$foreignProperties[$key], $tableName)) {
453+
454+
$localPropertiesArray = (array)($localProperties[$key] ?? []);
455+
$foreignPropertiesArray = (array)($foreignProperties[$key] ?? []);
456+
457+
if (!$this->isIgnoredRecord($localPropertiesArray, $foreignPropertiesArray, $tableName)) {
454458
$foundRecords[$key] = $this->recordFactory->makeInstance(
455459
$this,
456-
(array)$localProperties[$key],
457-
(array)$foreignProperties[$key],
460+
$localPropertiesArray,
461+
$foreignPropertiesArray,
458462
[],
459463
$tableName,
460464
'uid',
@@ -1061,6 +1065,9 @@ protected function getRecordsByFlexFormRelation(
10611065
$recordId = $record->getIdentifier();
10621066
switch ($config['type']) {
10631067
case 'select':
1068+
if (empty($config['foreign_table'])) {
1069+
break;
1070+
}
10641071
$whereClause = '';
10651072
if (!empty($config['foreign_table_where'])) {
10661073
$whereClause = $config['foreign_table_where'];
@@ -1170,7 +1177,7 @@ protected function fetchRelatedRecordsByGroupTypeDb(
11701177
}
11711178
}
11721179
foreach ($identifierToTableMap as $tableName => $identifiers) {
1173-
if ($columnConfiguration['MM']) {
1180+
if (!empty($columnConfiguration['MM'])) {
11741181
$this->logger->alert(
11751182
'Missing implementation: GROUP MM',
11761183
[

Classes/Controller/FileController.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@
5252
use function count;
5353
use function dirname;
5454
use function json_encode;
55-
use function ltrim;
55+
use function explode;
56+
use function is_string;
5657
use function reset;
58+
use function strlen;
5759
use function strpos;
60+
use function trim;
5861

5962
/**
6063
* The FileController is responsible for the "Publish Files" Backend module "m2"
@@ -172,7 +175,7 @@ public function publishFileAction(int $uid, string $identifier, int $storage, bo
172175
[$identifier] = GeneralUtility::trimExplode(',', $identifier);
173176
}
174177

175-
$record = $this->tryToGetFolderInstance($storage . ':/' . ltrim(dirname($identifier), '/'));
178+
$record = $this->tryToGetFolderInstance($storage . ':' . dirname($identifier));
176179

177180
if (null !== $record) {
178181
$relatedRecords = $record->getRelatedRecordByTableAndProperty('sys_file', 'identifier', $identifier);
@@ -233,6 +236,10 @@ public function toggleFilterStatusAction(string $filter): ResponseInterface
233236
*/
234237
protected function tryToGetFolderInstance(?string $identifier): ?RecordInterface
235238
{
239+
if (is_string($identifier) && strpos($identifier, ':') < strlen($identifier)) {
240+
[$storage, $name] = explode(':', $identifier);
241+
$identifier = $storage . ':' . trim($name, '/') . '/';
242+
}
236243
try {
237244
$record = $this->falFinder->findFalRecord($identifier);
238245
} catch (TooManyFilesException $exception) {

Classes/Domain/Driver/RemoteFileAbstractionLayerDriver.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ public function getFolderInfoByIdentifier($folderIdentifier): array
486486
* @psalm-return array{identifier: string, name: string, storage: int}
487487
*/
488488
function () use ($folderIdentifier): array {
489-
$folderIdentifier = $this->canonicalizeAndCheckFolderIdentifier($folderIdentifier);
490-
491489
if (!$this->folderExists($folderIdentifier)) {
492490
throw new FolderDoesNotExistException(
493491
'Folder "' . $folderIdentifier . '" does not exist.',
@@ -664,9 +662,9 @@ public function createFolder($newFolderName, $parentFolderIdentifier = '', $recu
664662
EnvelopeDispatcher::CMD_CREATE_FOLDER,
665663
[
666664
'storage' => $this->storageUid,
667-
'$newFolderName' => $newFolderName,
668-
'$parentFolderIdentifier' => $parentFolderIdentifier,
669-
'$recursive' => $recursive,
665+
'newFolderName' => $newFolderName,
666+
'parentFolderIdentifier' => $parentFolderIdentifier,
667+
'recursive' => $recursive,
670668
]
671669
)
672670
);

Classes/Domain/Factory/RecordFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ protected function detectAndAlterMovedInstance(
425425
} elseif (!empty($localProperties['pid']) && !empty($foreignProperties['pid'])) {
426426
if ($localProperties['pid'] !== $foreignProperties['pid']) {
427427
$hasBeenMoved = true;
428-
} elseif ($localProperties['sorting'] !== $foreignProperties['sorting']) {
428+
} elseif (
429+
($sortField = ($GLOBALS['TCA'][$tableName]['ctrl']['sortby'] ?? null))
430+
&& ($localProperties[$sortField] ?? null) !== ($foreignProperties[$sortField] ?? null)
431+
) {
429432
$hasBeenMoved = true;
430433
}
431434
}

Classes/Domain/Model/Record.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232

3333
use In2code\In2publishCore\Config\ConfigContainer;
34+
use In2code\In2publishCore\Event\DetermineIfRecordIsPublishing;
3435
use In2code\In2publishCore\Event\VoteIfRecordIsPublishable;
3536
use In2code\In2publishCore\Service\Configuration\TcaService;
3637
use In2code\In2publishCore\Service\Permission\PermissionService;
@@ -1120,6 +1121,10 @@ public function isPublishable(): bool
11201121
if (!$this->isChangedRecursive()) {
11211122
return false;
11221123
}
1124+
if ($this->isPublishing()) {
1125+
return false;
1126+
}
1127+
11231128
$permissionService = GeneralUtility::makeInstance(PermissionService::class);
11241129
if (!$permissionService->isUserAllowedToPublish()) {
11251130
return false;
@@ -1130,6 +1135,14 @@ public function isPublishable(): bool
11301135
return $event->getVotingResult();
11311136
}
11321137

1138+
public function isPublishing(): bool
1139+
{
1140+
$eventDispatcher = GeneralUtility::makeInstance(EventDispatcher::class);
1141+
$event = new DetermineIfRecordIsPublishing($this->tableName, $this->getIdentifier());
1142+
$eventDispatcher->dispatch($event);
1143+
return $event->isPublishing();
1144+
}
1145+
11331146
public function isRemovedFromLocalDatabase(): bool
11341147
{
11351148
return $this->isForeignRecordDeleted() && !$this->isRecordRepresentByProperties($this->localProperties);

Classes/Domain/Model/RecordInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,7 @@ public function getRecordLanguage(): int;
258258

259259
public function isPublishable(): bool;
260260

261+
public function isPublishing(): bool;
262+
261263
public function isRemovedFromLocalDatabase(): bool;
262264
}

0 commit comments

Comments
 (0)