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

TYPO3 9.5: Error when accessing page properties and frontend #409

Closed
jfroehl opened this issue May 2, 2019 · 18 comments
Closed

TYPO3 9.5: Error when accessing page properties and frontend #409

jfroehl opened this issue May 2, 2019 · 18 comments

Comments

@jfroehl
Copy link

jfroehl commented May 2, 2019

Hi FluidTYPO3 team,

I generated a provider extension with the following command:
typo3cms builder:providerextension --use-vhs --pages --content --controllers.

Then I created a root template (for a new site) where I included "Fluid Content Elements" and the TypoScript of my provider extension.

Everything else I left unchanged, meaning the root paths to templates, partials, and layouts in my provider extension are:
templateRootPaths.0 = EXT:provider/Resources/Private/Templates/
partialRootPaths.0 = EXT:provider/Resources/Private/Partials/
layoutRootPaths.0 = EXT:provider/Resources/Private/Layouts/

When I try to access the page properties of a page, I get the following error

Argument 1 passed to TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection::add() must be an instance of TYPO3\CMS\Backend\View\BackendLayout\BackendLayout, null given, called in /var/www/public/typo3conf/ext/fluidpages/Classes/Backend/BackendLayoutDataProvider.php on line 92

In the frontend, I get the error

#1257246929 TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException
Tried resolving a template file for controller action "Page->default" in format ".html", but none of the paths contained the expected template file (). The following paths were checked: /var/www/public/typo3conf/ext/fluidpages/Resources/Private/Templates/

My configuration is:

  • TYPO3 9.5.5
  • builder 1.2.0
  • fluidpages 5.0.0
  • flux 9.2.0
  • vhs 5.2.0
    (all these extensions are activated)

When disabling "fluidpages", I can access the page properties and the frontend view also throws no error.

Is there anything I'm missing? Do I need to write more configuration in order to be able to use fluidpages? I already searched the Internet for any hints, but without success.

Any help is appreciated. Please let me know, if I can provide you with more information.

Thanks
Jochen

@kraemer-igroup
Copy link

I guess this is a bug, I get similar erros. You can take a look at the comment within this commit, maybe it can fix your problem (it does for me):
9fb60ec

@jfroehl
Copy link
Author

jfroehl commented May 2, 2019

Thank you very much! That indeed fixed the problem.
Page properties and frontend view are working now!

Cheers
Jochen

@X-Tender
Copy link

X-Tender commented May 15, 2019

I stumbled upon this Issue because I ran into the same Error, but my version have already the mentioned fix in it.

The error appears when I try to Edit a "Folder" in the Page tree which is not under the Root page (The Icon with the Globe) When I remove the fix from the BackendLayoutDataProvider the error disappear and I can Edit the Folderpages Properties.

Is it just an inconvenient way to place Folders (for example storage folders) otuside of the Root? Or does we have here an another Bug?

Here's the full error message.

Argument 1 passed to TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection::add() must be an instance of TYPO3\CMS\Backend\View\BackendLayout\BackendLayout, null given, called in /html/typo3-staging/typo3conf/ext/fluidpages/Classes/Backend/BackendLayoutDataProvider.php on line 92

I tried to resolve the issue my modify the getBackendLayoutMethode into this:

public function getBackendLayout($identifier, $pageUid)
{
    $record = $this->recordService->getSingle('pages', '*', $pageUid);
    if (null === $record) {
        return new BackendLayout('empty', 'Empty', '');
    }
    $grid = $this->resolveProvider($record)->getGrid($record);
    if (!$grid->hasChildren()) {
        $backendLayout = parent::getBackendLayout($identifier, $pageUid);
        if(null === $backendLayout){
            return new BackendLayout('empty', 'Empty', '');
        }
        return $backendLayout;
    }
    return $grid->buildBackendLayout(0);
}

@kraemer-igroup
Copy link

Please just try to change it into this: return parent::getBackendLayout('default', $pageUid);
The "fix" is not the commit but the included comment of line 110. I got the exact same error message like you for folders outside the root, so I guess this should work.

@X-Tender
Copy link

Ok, changed it and worked too. Thank you.

@dkm-bb
Copy link

dkm-bb commented Jun 12, 2019

Hi - I experience this error when creating new pages inside the root page?

TYPO3 9.5.7, fluidpages 5.0.0

@NamelessCoder
Copy link
Member

@dkm-bb If possible, try the dev-development branch to confirm if that solves the issue. Guards have been added to the function in question.

@thomasschwarzott
Copy link

@NamelessCoder I'm experiencing the same error as @dkm-bb, also with the beta version of fluidpages from the development branch. Is there any real fix in sight?

@dennisdittrich
Copy link

Switch to dev-development solves the problem for me. Looking forward for next release. :)

@anglee72
Copy link

Had the same problem, same solution worked ... dev-branch installed.

@dextar47
Copy link

dextar47 commented Sep 9, 2019

Hi,
I am having same kind of problem in FE, "exception":"TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException: Tried resolving a template file for controller action "Page->default" in format ".html", but none of the paths contained the expected template file ()

This bug appears when current page is enabled and its parent is disabled.
if current page also disabled then it works without any error and also if parent and child both are enabled.

@NamelessCoder
Copy link
Member

Hi @dextar1,

It looks from the error message like you do not have TypoScript templateRootPaths and others defined for your extension. Perhaps you need to create this setup? The hint is the empty parenthesis which usually contains a list of expected file locations based on templateRootPaths in this case. When there is no list it's usually a TS configuration issue (TS not loaded, doesn't exist, has typo/syntax problem, etc.).

@dextar47
Copy link

dextar47 commented Sep 9, 2019

@NamelessCoder thanks for the quick reply. But templateRootPaths work when this page is disabled or page is enabled but under another enabled page. This error comes when current page is enabled and its parent is disabled.

@NamelessCoder
Copy link
Member

I don't think this is fluidpages-related, @dextar1 - I suspect it is by design in TYPO3 that you cannot load (statically included) TS that exists on disabled pages, so the root TS never gets resolved. This is probably different in preview mode but then you have to use the "view" context menu option from the backend to preview the pages.

I'm not 100% sure though so you should ask in TYPO3 slack if that's how TS is supposed to work / whether you have any options to change this.

@dnozdrin
Copy link

dnozdrin commented Oct 1, 2019

@dextar1 @NamelessCoder the bug with "template file for controller action "Page->default"" is related to ext:flux.
You'll get such error on FE in case you open a page with "tx_fed_page_controller_action" set to "Parent decides" whose parent page is hidden. \FluidTYPO3\Fluidpages\Service\PageService::getPageTemplateConfiguration() uses method
\FluidTYPO3\Flux\Service\RecordService::getSingle() to find parent pages. But the last one will take into account hidden pages only in case $GLOBALS['TSFE']->fePreview is set to "true". See \FluidTYPO3\Flux\Service\RecordService::setContextDependentRestrictionsForQueryBuilder()
Related to #410

@NamelessCoder
Copy link
Member

Closing the issue since the original problem is solved.

@papillon6
Copy link

The following error still occurs when adding a page in backend within the context menu of the page tree (right-click in context menu -> "New").

Tried resolving a template file for controller action "Page->default" in format ".html", but none of the paths contained the expected template file (). The following paths were checked: /www/path/to/typo3/typo3conf/ext/fluidpages/Resources/Private/Templates/

image

Configured page layout for subpages (in parent page) is set to "parent decides" in this case.

Using flux 9.4.2 with TYPO3 9.5.23

@NamelessCoder
Copy link
Member

NamelessCoder commented Dec 10, 2020

Fluidpages is obsolete, Flux 9.4+ contains the necessary functionality, you should uninstall Fluidpages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests