Skip to content

Commit

Permalink
Merge branch '9.0' into 5077-documentUriPlaceholders
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed Jun 9, 2024
2 parents 862fefb + 3450b04 commit 8eee095
Show file tree
Hide file tree
Showing 187 changed files with 12,490 additions and 11,782 deletions.
6 changes: 0 additions & 6 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
},
"suggest": {
},
"provide": {
},
"scripts": {
"lint:phpcs": "../../bin/phpcs --colors",
"lint:phpcs:fix": "../../bin/phpcbf --colors",
Expand All @@ -32,9 +30,6 @@
"FLOW_CONTEXT=Testing/Behat ../../bin/paratest --debug -v --functional --group parallel --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.BehavioralTests/Tests/Functional/Feature/WorkspacePublication/WorkspaceWritingDuringPublication.php",
"FLOW_CONTEXT=Testing/Behat ../../bin/paratest --debug -v --functional --group parallel --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.BehavioralTests/Tests/Functional/Feature/WorkspacePublication/WorkspaceWritingDuringPublication.php"
],
"test:functional": [
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.Core/Tests/Functional"
],
"test:behat-cli": "../../bin/behat -f progress --strict --no-interaction",
"test:behavioral": [
"@test:behat-cli -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
Expand All @@ -56,7 +51,6 @@
],
"test": [
"@test:unit",
"@test:functional",
"@test:behavioral",
"@test:parallel"
],
Expand Down
3 changes: 3 additions & 0 deletions Neos.ContentGraph.DoctrineDbalAdapter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"docs": "https://docs.neos.io/"
},
"license": "GPL-3.0+",
"provide": {
"neos/contentrepositoryregistry-storageclient": "self.version"
},
"require": {
"neos/contentrepository-core": "self.version",
"doctrine/dbal": "^2.13",
Expand Down
29 changes: 18 additions & 11 deletions Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace Neos\ContentGraph\DoctrineDbalAdapter;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\ContentGraph;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\NodeFactory;
use Neos\ContentRepository\Core\ContentGraphFactoryInterface;
Expand Down Expand Up @@ -46,22 +47,28 @@ public function buildForWorkspace(WorkspaceName $workspaceName): ContentGraph
'workspace'
));

$row = $this->dbal->executeQuery(
'
SELECT * FROM ' . $tableName . '
WHERE workspaceName = :workspaceName
LIMIT 1
',
[
$currentContentStreamIdStatement = <<<SQL
SELECT
currentcontentstreamid
FROM
{$tableName}
WHERE
workspaceName = :workspaceName
LIMIT 1
SQL;
try {
$currentContentStreamId = $this->dbal->fetchOne($currentContentStreamIdStatement, [
'workspaceName' => $workspaceName->value,
]
)->fetchAssociative();
]);
} catch (Exception $e) {
throw new \RuntimeException(sprintf('Failed to load workspace content stream id from database: %s', $e->getMessage()), 1716486077, $e);
}

if ($row === false) {
if ($currentContentStreamId === false) {
throw WorkspaceDoesNotExist::butWasSupposedTo($workspaceName);
}

return $this->buildForWorkspaceAndContentStream($workspaceName, ContentStreamId::fromString($row['currentcontentstreamid']));
return $this->buildForWorkspaceAndContentStream($workspaceName, ContentStreamId::fromString($currentContentStreamId));
}

public function buildForWorkspaceAndContentStream(WorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraph
Expand Down
Loading

0 comments on commit 8eee095

Please sign in to comment.