Skip to content

Commit a97505e

Browse files
committed
[RELEASE] Version 9.1.0 with translated record handling and support info
2 parents 017c188 + b459231 commit a97505e

File tree

22 files changed

+284
-27
lines changed

22 files changed

+284
-27
lines changed

CHANGELOG.md

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

3+
9.1.0:
4+
5+
- [META] Set the branch alias version number to 9.1.x-dev
6+
- [META] Set the EM conf version number to 9.1.0
7+
- [BUGFIX] Run tasks after publishing files and folders
8+
- [FEATURE] Handle translated records as a special kind of record
9+
- [BUGFIX] Include translated records in changed state calculation
10+
- [FEATURE] Identify translations of records as special records, display with flag
11+
- [BUGFIX] Do not attempt to modify preview URLs of files which already are full qualified
12+
- [BUGFIX] Inherit the correct FQCN from the changed EXT:logs controller
13+
- [BUGFIX] Allow FlexForm config arrays without TCEforms index
14+
- [BUGFIX] Prevent PageTS caching before ext_tables and the TCA is loaded
15+
- [FEATURE] Show support info in publish tools module index
16+
- [DOCS] Add known issue about typo3/cms-redirects
17+
- [BUGFIX] Build compare URIs with the correct arguments for cHash calculation
18+
- [BUGFIX] Do not rely on the internal implementation of ArrayObject
19+
- [RELEASE] Version 9.0.2 with fixed RCE option type
20+
321
9.0.2:
422

523
- [META] Set the EM conf version number to 9.0.1

Classes/Config/Node/Generic/GenInteger.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public function cast($value): array
5959
{
6060
$tmp = [];
6161
foreach ($value as $key => $var) {
62-
$valueNode = reset($this->nodes);
62+
$nodes = $this->nodes->getArrayCopy();
63+
$valueNode = reset($nodes);
6364
$casted = $valueNode->cast($var);
6465
$tmp[(int)$key] = $casted;
6566
unset($value[$key]);

Classes/Config/Node/Generic/GenString.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public function cast($value): array
5959
{
6060
$tmp = [];
6161
foreach ($value as $key => $var) {
62-
$tmp[(string)$key] = reset($this->nodes)->cast($var);
62+
$nodes = $this->nodes->getArrayCopy();
63+
$tmp[(string)$key] = reset($nodes)->cast($var);
6364
unset($value[$key]);
6465
}
6566
return $tmp;

Classes/Config/Provider/PageTsProvider.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,35 @@
3434
use In2code\In2publishCore\Utility\DatabaseUtility;
3535
use TYPO3\CMS\Backend\Utility\BackendUtility as CoreBackendUtility;
3636
use TYPO3\CMS\Core\Database\Connection;
37+
use TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface;
3738
use TYPO3\CMS\Core\Utility\GeneralUtility;
3839

3940
/**
4041
* Class PageTsProvider
4142
*/
42-
class PageTsProvider implements ProviderInterface, ContextualProvider
43+
class PageTsProvider implements ProviderInterface, ContextualProvider, TableConfigurationPostProcessingHookInterface
4344
{
45+
/**
46+
* @var bool
47+
*/
48+
protected $locked = true;
49+
50+
/**
51+
* This method is called after loading all ext_tables.php
52+
* The PageTS provider is locked until that point to prevent premature loading and therefore caching of the PageTS.
53+
* (e.g. flux registers content elements for the NewContentElementWizard dynamically after ext_tables.php loading)
54+
*/
55+
public function processData()
56+
{
57+
$this->locked = false;
58+
}
59+
4460
/**
4561
* @return bool
4662
*/
4763
public function isAvailable()
4864
{
49-
return $this->getDatabase() instanceof Connection;
65+
return !$this->locked && $this->getDatabase() instanceof Connection;
5066
}
5167

5268
/**

Classes/Controller/FileController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function indexAction()
8181
public function publishFolderAction($identifier)
8282
{
8383
$success = GeneralUtility::makeInstance(FolderPublisherService::class)->publish($identifier);
84+
$this->runTasks();
8485

8586
if ($success) {
8687
$this->addFlashMessage(
@@ -144,6 +145,7 @@ public function publishFileAction($uid, $identifier, $storage)
144145
LocalizationUtility::translate('file_publishing.failure', 'in2publish_core')
145146
);
146147
}
148+
$this->runTasks();
147149
}
148150

149151
try {

Classes/Controller/ToolsController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ public function indexAction()
133133
);
134134
}
135135

136+
$supports = [
137+
LocalizationUtility::translate('help.github_issues', 'in2publish_core'),
138+
LocalizationUtility::translate('help.slack_channel', 'in2publish_core'),
139+
];
140+
[$supports] = $this->signalSlotDispatcher->dispatch(
141+
ToolsController::class,
142+
'collectSupportPlaces',
143+
[$supports]
144+
);
145+
$this->view->assign('supports', $supports);
146+
136147
$this->view->assign('tools', GeneralUtility::makeInstance(ToolsRegistry::class)->getTools());
137148
}
138149

Classes/Domain/Factory/RecordFactory.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,9 @@ public function endSimulation()
627627
/**
628628
* @param RecordInterface $record
629629
* @param CommonRepository $commonRepository
630-
* @param string|null $forceRelatedRecordTable
631630
*/
632-
protected function findTranslations(
633-
RecordInterface $record,
634-
CommonRepository $commonRepository,
635-
string $forceRelatedRecordTable = null
636-
) {
631+
protected function findTranslations(RecordInterface $record, CommonRepository $commonRepository): void
632+
{
637633
$tableName = $record->getTableName();
638634

639635
$tcaService = GeneralUtility::makeInstance(TcaService::class);
@@ -653,7 +649,7 @@ protected function findTranslations(
653649
$tableName
654650
);
655651
foreach ($translatedRecords as $translatedRecord) {
656-
$record->addRelatedRecordRaw($translatedRecord, $forceRelatedRecordTable ?? $tableName);
652+
$record->addTranslatedRecord($translatedRecord);
657653
}
658654
}
659655
}

Classes/Domain/Model/Record.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ class Record implements RecordInterface
155155
*/
156156
protected $configContainer;
157157

158+
/**
159+
* @var RecordInterface[]
160+
*/
161+
protected $translatedRecords = [];
162+
158163
/**
159164
* @param string $tableName
160165
* @param array $localProperties
@@ -272,6 +277,11 @@ public function getStateRecursive(array &$alreadyVisited = []): string
272277
}
273278
$alreadyVisited[$this->tableName][] = $this->getIdentifier();
274279
if (!$this->isChanged()) {
280+
foreach ($this->getTranslatedRecords() as $translatedRecord) {
281+
if ($translatedRecord->isChangedRecursive($alreadyVisited)) {
282+
return static::RECORD_STATE_CHANGED;
283+
}
284+
}
275285
foreach ($this->getRelatedRecords() as $tableName => $relatedRecords) {
276286
if ($tableName === 'pages') {
277287
continue;
@@ -565,6 +575,23 @@ public function getRelatedRecords(): array
565575
return $this->relatedRecords;
566576
}
567577

578+
/**
579+
* @return RecordInterface[]
580+
*/
581+
public function getTranslatedRecords(): array
582+
{
583+
return $this->translatedRecords;
584+
}
585+
586+
/**
587+
* @param RecordInterface $record
588+
* @return void
589+
*/
590+
public function addTranslatedRecord(RecordInterface $record): void
591+
{
592+
$this->translatedRecords[$record->getIdentifier()] = $record;
593+
}
594+
568595
/**
569596
* NOTICE: This will not work if debug.disableParentRecords is disabled!
570597
*
@@ -1206,4 +1233,17 @@ public function isTranslation(): bool
12061233
&& array_key_exists($languageField, $this->localProperties)
12071234
&& $this->localProperties[$languageField] > 0;
12081235
}
1236+
1237+
public function getRecordLanguage(): int
1238+
{
1239+
$language = 0;
1240+
1241+
$tcaService = GeneralUtility::makeInstance(TcaService::class);
1242+
$languageField = $tcaService->getLanguageField($this->tableName);
1243+
if (!empty($languageField) && array_key_exists($languageField, $this->localProperties)) {
1244+
$language = $this->localProperties[$languageField];
1245+
}
1246+
1247+
return $language;
1248+
}
12091249
}

Classes/Domain/Model/RecordInterface.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@ public function getMergedProperty($propertyName);
218218
*/
219219
public function getRelatedRecords(): array;
220220

221+
/**
222+
* @return RecordInterface[]
223+
*/
224+
public function getTranslatedRecords(): array;
225+
226+
/**
227+
* @param RecordInterface $record
228+
* @return void
229+
*/
230+
public function addTranslatedRecord(RecordInterface $record): void;
231+
221232
/**
222233
* NOTICE: This will not work if debug.disableParentRecords is disabled!
223234
*
@@ -358,4 +369,6 @@ public function getPageIdentifier(): int;
358369
* @return int
359370
*/
360371
public function getSuperordinatePageIdentifier(): int;
372+
373+
public function getRecordLanguage(): int;
361374
}

Classes/Domain/Repository/CommonRepository.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,8 @@ protected function flattenFieldFlexForm(array $flattenedDefinition, array $field
923923
}
924924
}
925925
}
926+
} elseif (array_key_exists('config', $fieldDefinition)) {
927+
$flattenedDefinition[$fieldKey] = $fieldDefinition['config'];
926928
}
927929
return $flattenedDefinition;
928930
}
@@ -2050,6 +2052,9 @@ protected function publishRecordRecursiveInternal(RecordInterface $record, array
20502052
*/
20512053
protected function publishRelatedRecordsRecursive(RecordInterface $record, array $excludedTables)
20522054
{
2055+
foreach ($record->getTranslatedRecords() as $translatedRecord) {
2056+
$this->publishRecordRecursiveInternal($translatedRecord, $excludedTables);
2057+
}
20532058
foreach ($record->getRelatedRecords() as $tableName => $relatedRecords) {
20542059
if (!in_array($tableName, $excludedTables) && is_array($relatedRecords)) {
20552060
/** @var RecordInterface $relatedRecord */

0 commit comments

Comments
 (0)