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

BUGFIX: Skip null when publishing nodes #3875

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

kdambekalns
Copy link
Member

The getNodeFromContextPath(…) in the Neos.Ui NodeService may return null, passing that to publishNodde(…) fails:

Exception in line 240 of /…/Flow_Object_Classes/Neos_Neos_Ui_Controller_BackendServiceController.php:
Neos\Neos\Service\PublishingService_Original::publishNode(): Argument #1 ($node) must be of type
Neos\ContentRepository\Domain\Model\NodeInterface, null given, called in
/…/Neos_Neos_Ui_Controller_BackendServiceController.php on line 240

This change adds a check and skips those nodes.

How to verify it

I see this error in a client project quite often, but sadly do not have a reproducer. Looking at the code shows this can happen, though.

The `getNodeFromContextPath(…)` in the Neos.Ui `NodeService` may return `null`, passing these to `publishNodde(…)` fails.

This change adds a check and skips those nodes.
@kdambekalns kdambekalns self-assigned this Oct 21, 2024
@github-actions github-actions bot added Bug Label to mark the change as bugfix 8.3 labels Oct 21, 2024
@kdambekalns
Copy link
Member Author

I found this on my machine today (after quite some time trying to find a difference in installed packages between local and production setups). PhpStorm's local history says the code was added on October 16th, but I don't remember writing it. 🙃 So maybe it's from somewhere else, but I could not find anything. So I created this PR.

A variant of the (potential) error fixed in the previous commit.
@skurfuerst
Copy link
Member

makes sense, thanks :)

@skurfuerst skurfuerst merged commit a5b7015 into neos:8.3 Oct 23, 2024
7 of 8 checks passed
@kdambekalns kdambekalns deleted the bugfix/handle-publishing-null-nodes branch November 4, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.3 Bug Label to mark the change as bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants