Skip to content

Commit 9796baa

Browse files
authored
Merge pull request #11 from netlogix/fix/publish-node-with-null
2 parents 849f41d + 1745188 commit 9796baa

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

Classes/Aspect/WorkspaceControllerPublishAspect.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
use Neos\Flow\Utility\Algorithms;
1313
use Neos\Neos\Ui\ContentRepository\Service\NodeService;
1414
use Neos\Neos\Ui\Controller\BackendServiceController;
15-
use Neos\Neos\Ui\Domain\Model\Feedback\Messages\Success;
1615
use Neos\Neos\Ui\Domain\Model\FeedbackCollection;
17-
use Neos\Utility\ObjectAccess;
1816
use Netlogix\Neos\AsyncWorkspaceActions\Domain\Model\Job;
1917
use Netlogix\Neos\AsyncWorkspaceActions\Domain\Repository\JobRepository;
2018
use Netlogix\Neos\AsyncWorkspaceActions\Job\Workspace\Publish;
@@ -81,20 +79,10 @@ public function publish(JoinPointInterface $joinPoint)
8179
assert($controller instanceof BackendServiceController);
8280

8381
$nodeContextPaths = $this->filterExistingContextPaths($joinPoint->getMethodArgument('nodeContextPaths'));
84-
if (count($nodeContextPaths) === 0) {
85-
$success = new Success();
86-
$success->setMessage('No nodes to publish');
87-
$this->feedbackCollection->add($success);
88-
89-
$view = ObjectAccess::getProperty($controller, 'view', true);
90-
$view->assign('value', $this->feedbackCollection);
91-
92-
return;
93-
}
82+
$joinPoint->setMethodArgument('nodeContextPaths', $nodeContextPaths);
9483

9584
$requestHandler = $this->bootstrap->getActiveRequestHandler();
96-
97-
if (!($requestHandler instanceof HttpRequestHandlerInterface) || count($nodeContextPaths) < $this->threshold) {
85+
if (!($requestHandler instanceof HttpRequestHandlerInterface) || count($nodeContextPaths) === 0 || count($nodeContextPaths) < $this->threshold) {
9886
$joinPoint->getAdviceChain()->proceed($joinPoint);
9987
return;
10088
}

0 commit comments

Comments
 (0)