Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Neos 9.0 compatibility #51

Open
wants to merge 57 commits into
base: 3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0a50e2f
WIP: FEATURE: Neos 9.0 Prototype
mhsdesign Jun 2, 2023
489eeca
FEATURE: First working draft. 1 functional Test passes ;)
mhsdesign Jun 9, 2023
5c916d4
FEATURE: Add support for setting references
mhsdesign Jun 9, 2023
358a33f
TASK: re-enable exception handling
mhsdesign Jun 10, 2023
7879e55
TASK: ensure node has uri path segment
mhsdesign Jun 10, 2023
e3e9020
TASK: Speed up tests by running in synchronous mode, and use own test…
mhsdesign Jun 10, 2023
cac831d
TASK: Re-enable other tests
mhsdesign Jun 10, 2023
f418051
TASK: Check for invalid node-constraints and update snapshots
mhsdesign Jun 10, 2023
df9b2fd
TASK: Update snapshot to contain `null` property value
mhsdesign Jun 10, 2023
cc9a6ed
TASK: Adjust to NeosUI commands->first update and expose parentNode i…
mhsdesign Jun 24, 2023
3312620
Upmerge nodetemplates version 2 changes into version 3-dev
mhsdesign Jun 24, 2023
85f19f7
TASK: Hackily fix test
mhsdesign Jul 5, 2023
ea14c42
Upmerge remote-tracking branch 'origin/feature/separateNodeCreationWi…
mhsdesign Jul 5, 2023
7b4b938
Merge remote-tracking branch 'origin/feature/separateNodeCreationWith…
mhsdesign Jul 17, 2023
d538e4d
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Jul 22, 2023
d0d6c24
TASK: Prepare tests for neos 9
mhsdesign Jul 22, 2023
2ca5e4e
TASK: Test patch neos stuff
mhsdesign Jul 22, 2023
a3ec2a6
TASK: Make nodeId deterministic for testing
mhsdesign Jul 23, 2023
8ddb961
TASK: Remove dependency to WIP branch and copy code
mhsdesign Aug 2, 2023
bede22e
TASK: Adjust to changes in Neos
mhsdesign Aug 2, 2023
94437e6
TASK: Fix generateUriPathSegment
mhsdesign Aug 2, 2023
80da04d
TASK: Fix uriPathSegment if it depends on the title of the node creat…
mhsdesign Aug 2, 2023
6e67fb6
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Oct 17, 2023
386ed35
TASK: Adjust to changes in neos 9 dev (with phpstan)
mhsdesign Oct 17, 2023
68dee0b
TASK: Fix ci distribution installation
mhsdesign Oct 17, 2023
157c85e
TASK: Use dev distribution in ci because sub splits are broken atm
mhsdesign Oct 18, 2023
3b9bee2
TASK: Adjust unit and functional tests to changes in neos 9 dev
mhsdesign Oct 18, 2023
e7f15bd
TASK: Use tetheredDescendantNodeAggregateIds instead of deterministic…
mhsdesign Oct 18, 2023
7b14b18
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Oct 18, 2023
50d4834
BUGFIX: Nested tethered nodes
mhsdesign Oct 18, 2023
357a93a
TASK: Level up Phpstan to 6
mhsdesign Oct 18, 2023
6db6c7e
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Oct 18, 2023
06fdf68
TASK: Level up ++ phpstan
mhsdesign Oct 18, 2023
9ca7918
TASK: Level up ++ phpstan to 8
mhsdesign Oct 18, 2023
91ade24
TASK: Update to adjustments in Neos and Neos.Ui
mhsdesign Jan 18, 2024
8dda881
TASK: Simplify `ContentRepositoryTestTrait`
mhsdesign Jan 18, 2024
706f343
TASK: Adjust to changes in the NeosUi
mhsdesign Feb 17, 2024
f4b07d3
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Feb 21, 2024
8671cd6
TASK: Adjust to changes in UI
mhsdesign Feb 24, 2024
5f3b21b
FEATURE: Neos9-Beta10 compatibility
mhsdesign Jun 21, 2024
4d1ccfa
BUGFIX: Add workaround for unsetting properties with default values
mhsdesign Jun 21, 2024
6b9fc67
TASK: Remove patches from CI after merge of 3519
mhsdesign Jun 21, 2024
e9c5b29
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Jun 21, 2024
383d614
TASK: Introduce `site` variable in Neos 9
mhsdesign Jun 21, 2024
88b623e
FEATURE: Neos9 support for `flow nodeTemplate:validate`
mhsdesign Jun 21, 2024
a5be69e
TASK: Unskip test after merge of core bugfix
mhsdesign Jun 21, 2024
96bd529
FEATURE: Migrate `flow nodeTemplate:createFromNodeSubtree` to Neos9
mhsdesign Jun 21, 2024
44c0f22
TASK: Use FlowEntitiesTrait::truncateAndSetupFlowEntities to reset pe…
mhsdesign Jun 21, 2024
feeec56
TASK: Run tests also on PHP8.3
mhsdesign Jun 21, 2024
f37b6c4
TASK: Hotfix for transaction errors in CI
mhsdesign Jun 21, 2024
0d6ae5b
TASK: Improve documentation of `nodeTemplate` CLI commands
mhsdesign Jun 21, 2024
90d7a69
TASK: Small cosmetic adjustment
mhsdesign Jun 21, 2024
3f0bad4
Merge remote-tracking branch 'origin/2.0' into neos9
mhsdesign Jun 21, 2024
f35a583
TASK: Improve DI for `TemplateNodeCreationHandler` and early return i…
mhsdesign Jun 22, 2024
67abdde
Adjust to Neos9 Beta15
Nov 11, 2024
773f5cb
Adjust tests to beta15
Nov 11, 2024
88c37a7
Adjust to beta 16
Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions Classes/Application/Command/NodeTemplateCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use Flowpack\NodeTemplates\Domain\NodeCreation\NodeCreationService;
use Flowpack\NodeTemplates\Domain\NodeTemplateDumper\NodeTemplateDumper;
use Flowpack\NodeTemplates\Domain\TemplateConfiguration\TemplateConfigurationProcessor;
use Neos\ContentRepository\Domain\Service\ContextFactoryInterface;
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;

Expand All @@ -21,12 +19,6 @@ class NodeTemplateCommandController extends CommandController
*/
protected $nodeCreationService;

/**
* @Flow\Inject
* @var ContextFactoryInterface
*/
protected $contextFactory;

/**
* @Flow\Inject
* @var NodeTemplateDumper
Expand All @@ -39,11 +31,6 @@ class NodeTemplateCommandController extends CommandController
*/
protected $templateConfigurationProcessor;

/**
* @Flow\Inject
* @var NodeTypeManager
*/
protected $nodeTypeManager;

/**
* Dump the node tree structure into a NodeTemplate YAML structure.
Expand All @@ -55,6 +42,8 @@ class NodeTemplateCommandController extends CommandController
*/
public function createFromNodeSubtreeCommand(string $startingNodeId, string $workspaceName = 'live'): void
{
// TODO re-enable
throw new \BadMethodCallException('Not implemented.');
$subgraph = $this->contextFactory->create([
'workspaceName' => $workspaceName
]);
Expand All @@ -74,6 +63,8 @@ public function createFromNodeSubtreeCommand(string $startingNodeId, string $wor
*/
public function validateCommand(): void
{
// TODO re-enable
throw new \BadMethodCallException('Not implemented.');
$templatesChecked = 0;
/**
* nodeTypeNames as index
Expand Down
22 changes: 12 additions & 10 deletions Classes/Domain/DelegatingDocumentTitleNodeCreationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

namespace Flowpack\NodeTemplates\Domain;

use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Ui\NodeCreationHandler\DocumentTitleNodeCreationHandler;
use Neos\Neos\Ui\NodeCreationHandler\NodeCreationCommands;
use Neos\Neos\Ui\NodeCreationHandler\NodeCreationHandlerInterface;

/**
Expand All @@ -23,21 +24,22 @@ class DelegatingDocumentTitleNodeCreationHandler implements NodeCreationHandlerI
*/
protected $originalDocumentTitleNodeCreationHandler;

/**
* @throws \Neos\Eel\Exception
* @throws \Neos\Neos\Exception
*/
public function handle(NodeInterface $node, array $data): void
{
$template = $node->getNodeType()->getOptions()['template'] ?? null;
public function handle(
NodeCreationCommands $commands,
array $data,
ContentRepository $contentRepository
): NodeCreationCommands {
$nodeType = $contentRepository->getNodeTypeManager()
->getNodeType($commands->first->nodeTypeName);
$template = $nodeType->getOptions()['template'] ?? null;
if (
!$template
|| !isset($template['properties']['uriPathSegment'])
) {
$this->originalDocumentTitleNodeCreationHandler->handle($node, $data);
return;
return $this->originalDocumentTitleNodeCreationHandler->handle($commands, $data, $contentRepository);
}

// do nothing, as we handle this already when applying the template
return $commands;
}
}
11 changes: 6 additions & 5 deletions Classes/Domain/ExceptionHandling/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Flowpack\NodeTemplates\Domain\ExceptionHandling;

use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\ContentRepository\Core\NodeType\NodeType;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\ThrowableStorageInterface;
use Neos\Flow\Log\Utility\LogEnvironment;
Expand Down Expand Up @@ -36,7 +37,7 @@ class ExceptionHandler
*/
protected $configuration;

public function handleAfterTemplateConfigurationProcessing(CaughtExceptions $caughtExceptions, NodeInterface $node): void
public function handleAfterTemplateConfigurationProcessing(CaughtExceptions $caughtExceptions, NodeType $nodeType, NodeAggregateId $nodeAggregateId): void
{
if (!$caughtExceptions->hasExceptions()) {
return;
Expand All @@ -47,7 +48,7 @@ public function handleAfterTemplateConfigurationProcessing(CaughtExceptions $cau
}

$templateNotCreatedException = new TemplateNotCreatedException(
sprintf('Template for "%s" was not applied. Only %s was created.', $node->getNodeType()->getLabel(), (string)$node),
sprintf('Template for "%s" was not applied. Only %s was created.', $nodeType->getLabel(), $nodeAggregateId->value),
1686135532992,
$caughtExceptions->first()->getException(),
);
Expand All @@ -57,14 +58,14 @@ public function handleAfterTemplateConfigurationProcessing(CaughtExceptions $cau
throw $templateNotCreatedException;
}

public function handleAfterNodeCreation(CaughtExceptions $caughtExceptions, NodeInterface $node): void
public function handleAfterNodeCreation(CaughtExceptions $caughtExceptions, NodeType $nodeType, NodeAggregateId $nodeAggregateId): void
{
if (!$caughtExceptions->hasExceptions()) {
return;
}

$templatePartiallyCreatedException = new TemplatePartiallyCreatedException(
sprintf('Template for "%s" only partially applied. Please check the newly created nodes beneath %s.', $node->getNodeType()->getLabel(), (string)$node),
sprintf('Template for "%s" only partially applied. Please check the newly created nodes beneath %s.', $nodeType->getLabel(), $nodeAggregateId->value),
1686135564160,
$caughtExceptions->first()->getException(),
);
Expand Down
Loading