BUG: Endless loading orange line in Neos 7.3 backend with custom controller with Fusion view #4121
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
In Neos 7.3 a custom controller with Fusion view and including the Neos core Fusion libraries via
include: resource://neos.fusion/Private/Fusion/Root.fusion
include: resource://neos.neos/Private/Fusion/Root.fusion
breaks the Neos UI in that it is endlessly loading the orange line at the top.
Expected Behavior
It should be possible to implement a controller with Fusion view and using the core Fusion libraries comfortably with the above mentioned aggregation includes.
Steps To Reproduce
DistributionPackages/MyWebsite.Site/Configuration/Settings.yaml
Neos:
Flow:
mvc:
routes:
..
'MyWebsite.Site':
position: 'before Neos.Neos'
DistributionPackages/MyWebsite.Site/Configuration/Policy.yaml
privilegeTargets:
'Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege':
'MyWebsite.Site:Articles':
label: Articles API
matcher: 'method(MyWebsite\Site\Controller\Service\ArticlesController->listAction())'
roles:
'Neos.Flow:Everybody':
privileges:
-
privilegeTarget: 'MyWebsite.Site:Articles'
permission: GRANT
DistributionPackages/MyWebsite.Site/Configuration/Routes.yaml
-
name: 'My Website :: Articles API'
uriPattern: 'articles/{@action}'
defaults:
'@package': 'MyWebsite.Site'
'@controller': 'Service\Articles'
appendExceedingArguments: true
DistributionPackages/MyWebsite.Site/Classes/Controller/Service/ArticlesController.php
<?php
namespace MyWebsite\Site\Controller\Service;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Controller\ActionController;
use Neos\Fusion\View\FusionView;
/**
* @Flow\Scope("singleton")
*/
class ArticlesController extends ActionController
{
protected $defaultViewObjectName = FusionView::class;
public function listAction(): void {}
}
DistributionPackages/MyWebsite.Site/Resources/Private/Fusion/Controller/ArticlesController.fusion
include: resource://neos.fusion/Private/Fusion/Root.fusion
include: resource://neos.neos/Private/Fusion/Root.fusion
MyWebsite.Site.Service.ArticlesController.list = Neos.Fusion:Component {
renderer = Neos.Neos:ContentComponent {
renderer = 'Causes an endless loading animation in the Neos 7.3 backend.'
}
}
Environment
- Flow: 7.3
- Neos: 7.3
- PHP: 7.4
Anything else?
In-depth analysis revealed that
prototype(Neos.Neos:Page) >
in Packages/Application/Neos.Neos/Resources/Private/Fusion/Prototypes/Page.fusion is responsible here and commenting it in fixes the endless loading.
A temporary fix is to replace the generic
include: resource://neos.fusion/Private/Fusion/Root.fusion
include: resource://neos.neos/Private/Fusion/Root.fusion
with the specifically required Fusion files of the Neos.Neos package, e.g.
include: resource://neos.fusion/Private/Fusion/Root.fusion
include: resource://neos.neos/Private/Fusion/Prototypes/ContentComponent.fusion
include: resource://neos.neos/Private/Fusion/Prototypes/ContentElementWrapping.fusion
include: resource://neos.neos/Private/Fusion/Prototypes/NodeUri.fusion
include: resource://neos.neos/Private/Fusion/Prototypes/NodeLink.fusion
which hopefully do not include the Page.fusion :)