Skip to content

Commit b57eebb

Browse files
committed
[RELEASE] Version 12.6.0 with new UI
Related: https://projekte.in2code.de/issues/72637
2 parents 95f0ac6 + 3907e18 commit b57eebb

File tree

118 files changed

+11089
-435
lines changed

Some content is hidden

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

118 files changed

+11089
-435
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
testsuite:
1111
name: all tests
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-24.04
1313
# strategy:
1414
# matrix:
1515
# php: [ '7.4', '8.0' ]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Build/.phpunit.result.cache
2424
.php-cs-fixer.cache
2525
composer.lock
2626
docker-compose.yaml
27+
node_modules/

CHANGELOG.md

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

3+
12.6.0:
4+
- [DOCS] Update Changelog.md
5+
- [META] Set the EM conf version number to 12.6.0
6+
- [DOC] Add upgrade documentation
7+
- [BUGFIX] Fix wrong characters in PageRow.html condition
8+
- [BUGFIX] Remove usage of ConditionViewHelper from EXT:in2publish
9+
- [BUGFIX] Show status for deleted pages in OverviewModule
10+
- [BUGFIX] Fix PublishButtonWithWarning displayed when record is publishable ignoring dependencies
11+
- [BUGFIX] Eliminate not publishable warning for unchanged elements
12+
- [BUGFIX] Show publishing action only if user is allowed to publish
13+
- [DOC] Adjust documentation and change screenshots
14+
- [BUGFIX] Show language flag also for default language
15+
- [BUGFIX] Fix layout of topmost "table" page header
16+
- [TASK] Add header to OverviewModule
17+
- [TEST] Fix PublishChangedNewsTest
18+
- [TEST] Fix UidClashTest
19+
- [TEST] Fix RecordTreeDisplayTest
20+
- [TEST] Fix PublishTranslationTest
21+
- [TEST] Fix PublishChangedPagePropertiesTest
22+
- [TEST] Fix PublishChangedContentTest
23+
- [TEST] Fix PublishingRecordWithDependencyTest
24+
- [TEST] Add make task for execution of single tests
25+
- [BUGFIX] Fix getChildPagesWithoutTranslations in AbstractRecord
26+
- [TASK] Improve layout for translated page records in Publish Overview
27+
- [TASK] Provide method getChildPagesWithoutTranslations in RecordTree, Node and AbstractRecord in order to fix display of records in OverviewModule
28+
- [GIT] update github workflow testsuite image
29+
- [BUGFIX] fix request access check
30+
- [TASK] Fix spacing of elements in publish overview page rows
31+
- [TASK] Add language filtering to publish overview
32+
- [COMMENT] Add comment to LanguageAugmentation
33+
- [TASK] Display reasons why record is not publishable in OverviewModule using a new InformationModal without publish buttons
34+
- [BUGFIX] Display ReasonsWhyRecordIsNotPublishable in WorkflowModule
35+
- [BUGFIX] Replace in2publish ContentLanguage with SiteLanguage in SiteLanguageService
36+
- [WIP] Add language filter to OverviewModule
37+
- [TASK] Assign available languages to PublishOverviewModule
38+
- [REFACTOR] Move SiteLanguageServie from EXT:in2publish to EXT:in2publish_core
39+
- [TASK] Provide event to decide if translations should be included in publishing
40+
- [FEATURE] Add event listener language augmentation limiting the publishing to the selected languages
41+
- [BUGFIX] Make searches case-insensitive
42+
- [BUGFIX] Fix spacing of in2publish-page entries to prevent whitespace in searches
43+
- [TASK] Don't render function bar in publish overview
44+
- [TASK] Rebuild frontend assets
45+
- [TASK] Move SCSS files into new build location
46+
- [TASK] Add updated tooling to build SCSS
47+
- [FEATURE] Implement new publish overview
48+
- [DEV] Add some make tasks for local development
49+
350
12.5.9:
451
- [META] Set the EM conf version number to 12.5.9
552
- [BUGFIX] Avoid trailing AND when additionalWhere is empty
@@ -929,7 +976,7 @@
929976
- [GIT] Ignore build and qa files when creating a production dist
930977
- [GIT] Ignore the .github folder when creating a production dist
931978

932-
1.0.9:
979+
11.0.9:
933980
- [META] Set the EM conf version number to 11.0.9
934981
- [BUGFIX] Search for file links only in href attributes
935982
- [BUGFIX] Do not enhance records with sys_redirects if they are excluded from publishing
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace In2code\In2publishCore\Component\Core\Demand\Augmentation;
6+
7+
use In2code\In2publishCore\Component\Core\Demand\Type\JoinDemand;
8+
use In2code\In2publishCore\Component\Core\Demand\Type\SelectDemand;
9+
use In2code\In2publishCore\Component\Core\Demand\Type\SysRedirectDemand;
10+
use In2code\In2publishCore\Component\Core\RecordTree\RecordTreeBuildRequest;
11+
use In2code\In2publishCore\Event\DemandsWereCollected;
12+
use TYPO3\CMS\Core\SingletonInterface;
13+
14+
use function array_map;
15+
use function array_merge;
16+
use function array_unique;
17+
use function implode;
18+
use function trim;
19+
20+
/**
21+
* This event listener listens to the event DemandsWereCollected and checks if there are languages in the request.
22+
* If there are, it adds a language condition to the demands.
23+
*/
24+
class LanguageAugmentation implements SingletonInterface
25+
{
26+
public ?RecordTreeBuildRequest $request = null;
27+
28+
public function __invoke(DemandsWereCollected $event): void
29+
{
30+
if (null === $this->request || empty($this->request->getLanguages())) {
31+
return;
32+
}
33+
34+
$languages = $this->request->getLanguages();
35+
$demands = $event->getDemands();
36+
$allDemands = $demands->getAll();
37+
38+
$languages = array_map('intval', array_unique(array_merge([-1, 0], $languages)));
39+
40+
$languageArray = implode(',', $languages);
41+
42+
foreach ($allDemands as $type => $tables) {
43+
switch ($type) {
44+
case SysRedirectDemand::class:
45+
case SelectDemand::class:
46+
foreach ($tables as $table => $wheres) {
47+
$languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? null;
48+
if ($languageField) {
49+
foreach ($wheres as $where => $value) {
50+
if (trim($where) !== '') {
51+
$where .= ' AND ';
52+
}
53+
$where .= $table . '.' . $languageField . ' IN(' . $languageArray .')';
54+
$allDemands[$type][$table][$where] = $value;
55+
}
56+
}
57+
}
58+
break;
59+
case JoinDemand::class:
60+
foreach ($tables as $table => $joinTables) {
61+
$languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? null;
62+
if ($languageField) {
63+
foreach ($joinTables as $joinTable => $wheres) {
64+
foreach ($wheres as $where => $value) {
65+
if (trim($where) !== '') {
66+
$where .= ' AND ';
67+
}
68+
$where .= $table . '.' . $languageField . ' IN(' . $languageArray;
69+
$allDemands[$type][$table][$joinTable][$where] = $value;
70+
}
71+
}
72+
}
73+
}
74+
break;
75+
}
76+
}
77+
$demands->setAll($allDemands);
78+
}
79+
}

Classes/Component/Core/Demand/Demands.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ public function addDemand(Demand $demand): void;
1212
public function unsetDemand(DemandRemover $demandRemover): void;
1313

1414
public function getDemandsByType(string $type): array;
15+
16+
public function getAll(): array;
17+
18+
public function setAll(array $demands): void;
1519
}

Classes/Component/Core/Demand/DemandsCollection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,14 @@ public function getDemandsByType(string $type): array
3535
{
3636
return $this->demands[$type] ?? [];
3737
}
38+
39+
public function getAll(): array
40+
{
41+
return $this->demands;
42+
}
43+
44+
public function setAll(array $demands): void
45+
{
46+
$this->demands = $demands;
47+
}
3848
}

Classes/Component/Core/Publisher/PublisherService.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use In2code\In2publishCore\Component\Core\Record\Model\Record;
99
use In2code\In2publishCore\Component\Core\RecordTree\RecordTree;
1010
use In2code\In2publishCore\Component\PostPublishTaskExecution\Service\TaskExecutionServiceInjection;
11+
use In2code\In2publishCore\Event\BeforePublishingTranslationsEvent;
1112
use In2code\In2publishCore\Event\PublishingOfOneRecordBegan;
1213
use In2code\In2publishCore\Event\PublishingOfOneRecordEnded;
1314
use In2code\In2publishCore\Event\RecordWasPublished;
@@ -127,9 +128,14 @@ protected function publishRecord(Record $record, bool $includeChildPages = false
127128
$this->eventDispatcher->dispatch(new RecordWasPublished($record));
128129
}
129130

130-
foreach ($record->getTranslations() as $translatedRecords) {
131-
foreach ($translatedRecords as $translatedRecord) {
132-
$this->publishRecord($translatedRecord, $includeChildPages);
131+
$translationEvent = new BeforePublishingTranslationsEvent($record, $includeChildPages);
132+
$this->eventDispatcher->dispatch($translationEvent);
133+
134+
if ($translationEvent->shouldProcessTranslations()) {
135+
foreach ($record->getTranslations() as $translatedRecords) {
136+
foreach ($translatedRecords as $translatedRecord) {
137+
$this->publishRecord($translatedRecord, $includeChildPages);
138+
}
133139
}
134140
}
135141

Classes/Component/Core/Record/Model/AbstractRecord.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class AbstractRecord implements Record
4747
*/
4848
protected array $parents = [];
4949
/**
50-
* @var array<Record>
50+
* @var array<int, array<int, Record>>
5151
*/
5252
protected array $translations = [];
5353
protected ?Record $translationParent = null;
@@ -121,6 +121,17 @@ public function getChildren(): array
121121
return $this->children;
122122
}
123123

124+
public function getChildPagesWithoutTranslations(): array
125+
{
126+
$childPages = $this->children['pages'] ?? [];
127+
foreach ($childPages as $id => $record) {
128+
if ($record->getTranslationParent() !== null) {
129+
unset($childPages[$id]);
130+
}
131+
}
132+
return $childPages;
133+
}
134+
124135
public function addParent(Record $parentRecord): void
125136
{
126137
$this->parents[] = $parentRecord;

Classes/Component/Core/Record/Model/Node.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ public function addChild(Record $record): void;
1919
* @return array<string, array<int|string, Record>>
2020
*/
2121
public function getChildren(): array;
22+
23+
public function getChildPagesWithoutTranslations(): array;
2224
}

Classes/Component/Core/RecordTree/RecordTree.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,15 @@ public function getCurrentPage(): ?Record
7474

7575
return null;
7676
}
77+
78+
public function getChildPagesWithoutTranslations(): array
79+
{
80+
$childPages = $this->children['pages'] ?? [];
81+
foreach ($childPages as $id => $record) {
82+
if ($record->getTranslationParent() !== null) {
83+
unset($childPages[$id]);
84+
}
85+
}
86+
return $childPages;
87+
}
7788
}

0 commit comments

Comments
 (0)