Skip to content

Commit 1ab38b4

Browse files
committed
Merge remote-tracking branch 'origin/9.0' into 9.1
2 parents 2868887 + 37049de commit 1ab38b4

File tree

305 files changed

+11712
-63700
lines changed

Some content is hidden

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

305 files changed

+11712
-63700
lines changed

.github/workflows/postgresql-versions.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ jobs:
151151
- name: Run behat tests
152152
if: ${{matrix.dependencies != 'lowest' }}
153153
run: |
154-
FLOW_CONTEXT=Testing/Behat ./flow behat:setup
155154
FLOW_CONTEXT=Testing/Behat ./flow doctrine:create
156155
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all
157156
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ We are currently in the process to create the identity for the Neos brand. If yo
4848

4949
### You have other skills that you think can be useful for the community?
5050

51-
Who knows, some of your skills are not in this list, but can be really useful for the community. You are a project manager, an event organizer, a brewer, a team builder and yoga trainer and you want to support an open source community, connect with us: **hello@neos.io**
51+
Who knows, some of your skills are not in this list, but can be really useful for the community. You are a project manager, an event organizer, a brewer, a team builder and yoga trainer and you want to support an open source community, connect with us: **hello@neos.io**
5252

5353
We certainly have a something that matches your dream job and where you can help the project.
5454

@@ -67,7 +67,7 @@ We spend our time on the following tools, you should have a good understanding o
6767

6868
- PHPunit (unit and functional testing)
6969
- Behat (functional testing)
70-
- GIT
70+
- GIT
7171

7272
You can find us on [Github](https://github.com/neos) and we also use it as our main issue tracker.
7373

@@ -101,15 +101,15 @@ If you have any questions, [we are happy to help you](https://www.neos.io/contac
101101
If you want to contribute to Neos and want to set up a development environment, then follow these steps:
102102

103103
```shell
104-
composer create-project neos/neos-development-distribution neos-development 8.3.x-dev --keep-vcs
104+
composer create-project neos/neos-development-distribution neos-development 9.0.x-dev --keep-vcs
105105
```
106106

107107
Note the **-distribution** repository you create a project from, instead of just checking out this repository.
108108

109-
If you need a different branch, you can either use it from the start (replace the ``8.3.x-dev`` by ``9.0.x-dev`` or whatever you need), or switch after checkout (just make sure to run composer update afterwards to get matching dependencies installed.) In a nutshell, to switch the branch you intend to work on, run:
109+
If you need a different branch, you can either use it from the start (replace the ``9.0.x-dev`` by ``8.3.x-dev`` or whatever you need), or switch after checkout (just make sure to run composer update afterwards to get matching dependencies installed.) In a nutshell, to switch the branch you intend to work on, run:
110110

111111
```shell
112-
git checkout 9.0 && composer update
112+
git checkout 8.3 && composer update
113113
```
114114

115115
The code of the CMS can then be found inside `Packages/Neos`, which itself is the neos-development-collection Git repository. You commit changes and create pull requests from this repository.

Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
1818
use Neos\Behat\FlowBootstrapTrait;
1919
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
20-
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider;
2120
use Neos\ContentRepository\Core\ContentRepository;
2221
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceFactoryInterface;
2322
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceInterface;
2423
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
24+
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRBehavioralTestsSubjectProvider;
2525
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteTrait;
26-
use Neos\ContentRepository\TestSuite\Fakes\FakeNodeTypeManagerFactory;
2726
use Neos\ContentRepository\TestSuite\Fakes\FakeContentDimensionSourceFactory;
27+
use Neos\ContentRepository\TestSuite\Fakes\FakeNodeTypeManagerFactory;
2828
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
2929

3030
/**

Neos.ContentGraph.DoctrineDbalAdapter/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"require": {
1515
"neos/contentrepository-core": "self.version",
16+
"neos/contentrepository-dbal": "self.version",
1617
"doctrine/dbal": "^3.1.4",
1718
"doctrine/migrations": "*"
1819
},

Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPublished;
6060
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceRebaseFailed;
6161
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceWasRebased;
62-
use Neos\ContentRepository\Core\Infrastructure\DbalSchemaDiff;
6362
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
6463
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphProjectionInterface;
6564
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphReadModelInterface;
@@ -71,6 +70,7 @@
7170
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
7271
use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName;
7372
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
73+
use Neos\ContentRepository\Dbal\DbalSchemaDiff;
7474
use Neos\EventStore\Model\EventEnvelope;
7575

7676
/**

Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
use Doctrine\DBAL\Connection;
88
use Doctrine\DBAL\Exception as DBALException;
99
use Doctrine\DBAL\Platforms\AbstractPlatform;
10-
use Doctrine\DBAL\Schema\AbstractSchemaManager;
1110
use Doctrine\DBAL\Schema\Column;
1211
use Doctrine\DBAL\Schema\Schema;
1312
use Doctrine\DBAL\Schema\Table;
1413
use Doctrine\DBAL\Types\Type;
1514
use Doctrine\DBAL\Types\Types;
16-
use Neos\ContentRepository\Core\Infrastructure\DbalSchemaFactory;
15+
use Neos\ContentRepository\Dbal\DbalSchemaFactory;
1716

1817
/**
1918
* @internal
@@ -101,7 +100,8 @@ private function createReferenceRelationTable(AbstractPlatform $platform): Table
101100
]);
102101

103102
return $table
104-
->setPrimaryKey(['name', 'position', 'nodeanchorpoint']);
103+
->setPrimaryKey(['name', 'position', 'nodeanchorpoint'])
104+
->addIndex(['nodeanchorpoint', 'destinationnodeaggregateid', 'position'], 'referenceresolution');
105105
}
106106

107107
private function createWorkspaceTable(AbstractPlatform $platform): Table

Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/SubtreeTagging.php

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,36 @@ trait SubtreeTagging
2525
private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePointSet $affectedDimensionSpacePoints, SubtreeTag $tag): void
2626
{
2727
$addTagToDescendantsStatement = <<<SQL
28-
UPDATE {$this->tableNames->hierarchyRelation()} h
28+
UPDATE {$this->tableNames->hierarchyRelation()} h
29+
JOIN (
30+
WITH RECURSIVE cte (id, dsp) AS (
31+
SELECT ch.childnodeanchor, ch.dimensionspacepointhash
32+
FROM {$this->tableNames->hierarchyRelation()} ch
33+
INNER JOIN {$this->tableNames->node()} n ON n.relationanchorpoint = ch.parentnodeanchor
34+
WHERE
35+
n.nodeaggregateid = :nodeAggregateId
36+
AND ch.contentstreamid = :contentStreamId
37+
AND ch.dimensionspacepointhash in (:dimensionSpacePointHashes)
38+
AND NOT JSON_CONTAINS_PATH(ch.subtreetags, 'one', :tagPath)
39+
UNION ALL
40+
SELECT
41+
dh.childnodeanchor,
42+
dh.dimensionspacepointhash
43+
FROM
44+
cte
45+
JOIN {$this->tableNames->hierarchyRelation()} dh ON dh.parentnodeanchor = cte.id
46+
AND dh.contentstreamid = :contentStreamId
47+
AND dh.dimensionspacepointhash = cte.dsp
48+
WHERE
49+
NOT JSON_CONTAINS_PATH(dh.subtreetags, 'one', :tagPath)
50+
)
51+
SELECT * FROM cte
52+
) subquery ON h.dimensionspacepointhash = subquery.dsp
53+
AND h.childnodeanchor = subquery.id
2954
SET h.subtreetags = JSON_INSERT(h.subtreetags, :tagPath, null)
30-
WHERE h.childnodeanchor IN (
31-
WITH RECURSIVE cte (id) AS (
32-
SELECT ch.childnodeanchor
33-
FROM {$this->tableNames->hierarchyRelation()} ch
34-
INNER JOIN {$this->tableNames->node()} n ON n.relationanchorpoint = ch.parentnodeanchor
35-
WHERE
36-
n.nodeaggregateid = :nodeAggregateId
37-
AND ch.contentstreamid = :contentStreamId
38-
AND ch.dimensionspacepointhash in (:dimensionSpacePointHashes)
39-
AND NOT JSON_CONTAINS_PATH(ch.subtreetags, 'one', :tagPath)
40-
UNION ALL
41-
SELECT
42-
dh.childnodeanchor
43-
FROM
44-
cte
45-
JOIN {$this->tableNames->hierarchyRelation()} dh ON dh.parentnodeanchor = cte.id
46-
AND dh.contentstreamid = :contentStreamId
47-
AND dh.dimensionspacepointhash in (:dimensionSpacePointHashes)
48-
WHERE
49-
NOT JSON_CONTAINS_PATH(dh.subtreetags, 'one', :tagPath)
50-
)
51-
SELECT DISTINCT id FROM cte
52-
)
53-
AND h.contentstreamid = :contentStreamId
54-
AND h.dimensionspacepointhash in (:dimensionSpacePointHashes)
55+
WHERE h.contentstreamid = :contentStreamId
5556
SQL;
57+
5658
try {
5759
$this->dbal->executeStatement($addTagToDescendantsStatement, [
5860
'contentStreamId' => $contentStreamId->value,
@@ -63,7 +65,7 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId
6365
'dimensionSpacePointHashes' => ArrayParameterType::STRING,
6466
]);
6567
} catch (DBALException $e) {
66-
throw new \RuntimeException(sprintf('Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479749, $e);
68+
throw new \RuntimeException(sprintf('1: Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479749, $e);
6769
}
6870

6971
$addTagToNodeStatement = <<<SQL
@@ -85,31 +87,17 @@ private function addSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId
8587
'dimensionSpacePointHashes' => ArrayParameterType::STRING,
8688
]);
8789
} catch (DBALException $e) {
88-
throw new \RuntimeException(sprintf('Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479840, $e);
90+
throw new \RuntimeException(sprintf('2: Failed to add subtree tag %s for content stream %s, node aggregate id %s and dimension space points %s: %s', $tag->value, $contentStreamId->value, $nodeAggregateId->value, $affectedDimensionSpacePoints->toJson(), $e->getMessage()), 1716479840, $e);
8991
}
9092
}
9193

9294
private function removeSubtreeTag(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePointSet $affectedDimensionSpacePoints, SubtreeTag $tag): void
9395
{
9496
$removeTagStatement = <<<SQL
9597
UPDATE {$this->tableNames->hierarchyRelation()} h
96-
SET subtreetags = IF((
97-
SELECT containsTag FROM (SELECT
98-
JSON_CONTAINS_PATH(gph.subtreetags, 'one', :tagPath) as containsTag
99-
FROM
100-
{$this->tableNames->hierarchyRelation()} gph
101-
INNER JOIN {$this->tableNames->hierarchyRelation()} ph ON ph.parentnodeanchor = gph.childnodeanchor
102-
INNER JOIN {$this->tableNames->node()} n ON n.relationanchorpoint = ph.childnodeanchor
103-
WHERE
104-
ph.parentnodeanchor = gph.childnodeanchor
105-
AND n.nodeaggregateid = :nodeAggregateId
106-
AND gph.contentstreamid = :contentStreamId
107-
AND gph.dimensionspacepointhash in (:dimensionSpacePointHashes)
108-
LIMIT 1) as containsTagSubQuery
109-
), JSON_SET(subtreetags, :tagPath, null), JSON_REMOVE(subtreetags, :tagPath))
110-
WHERE childnodeanchor IN (
111-
WITH RECURSIVE cte (id) AS (
112-
SELECT ph.childnodeanchor
98+
JOIN (
99+
WITH RECURSIVE cte (id, dsp) AS (
100+
SELECT ph.childnodeanchor, ph.dimensionspacepointhash
113101
FROM {$this->tableNames->hierarchyRelation()} ph
114102
INNER JOIN {$this->tableNames->node()} n ON n.relationanchorpoint = ph.childnodeanchor
115103
WHERE
@@ -118,19 +106,35 @@ private function removeSubtreeTag(ContentStreamId $contentStreamId, NodeAggregat
118106
AND ph.dimensionspacepointhash in (:dimensionSpacePointHashes)
119107
UNION ALL
120108
SELECT
121-
dh.childnodeanchor
109+
dh.childnodeanchor,
110+
dh.dimensionspacepointhash
122111
FROM
123112
cte
124113
JOIN {$this->tableNames->hierarchyRelation()} dh ON dh.parentnodeanchor = cte.id
125114
AND dh.contentstreamid = :contentStreamId
126-
AND dh.dimensionspacepointhash in (:dimensionSpacePointHashes)
115+
AND dh.dimensionspacepointhash = cte.dsp
127116
WHERE
128117
JSON_EXTRACT(dh.subtreetags, :tagPath) != TRUE
129118
)
130-
SELECT DISTINCT id FROM cte
131-
)
132-
AND contentstreamid = :contentStreamId
133-
AND dimensionspacepointhash in (:dimensionSpacePointHashes)
119+
SELECT * FROM cte
120+
) subquery ON h.dimensionspacepointhash = subquery.dsp
121+
AND h.childnodeanchor = subquery.id
122+
SET subtreetags = IF(
123+
(
124+
SELECT containsTag FROM (SELECT
125+
JSON_CONTAINS_PATH(gph.subtreetags, 'one', :tagPath) as containsTag
126+
FROM
127+
{$this->tableNames->hierarchyRelation()} gph
128+
INNER JOIN {$this->tableNames->hierarchyRelation()} ph ON ph.parentnodeanchor = gph.childnodeanchor
129+
INNER JOIN {$this->tableNames->node()} n ON n.relationanchorpoint = ph.childnodeanchor
130+
WHERE
131+
ph.parentnodeanchor = gph.childnodeanchor
132+
AND n.nodeaggregateid = :nodeAggregateId
133+
AND gph.contentstreamid = :contentStreamId
134+
LIMIT 1) as containsTagSubQuery
135+
), JSON_SET(subtreetags, :tagPath, null), JSON_REMOVE(subtreetags, :tagPath)
136+
)
137+
WHERE contentstreamid = :contentStreamId
134138
SQL;
135139
try {
136140
$this->dbal->executeStatement($removeTagStatement, [

0 commit comments

Comments
 (0)