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: Still error when accessing page properties #417

Closed
Beenheed opened this issue Mar 9, 2020 · 7 comments
Closed

TYPO3 9.5: Still error when accessing page properties #417

Beenheed opened this issue Mar 9, 2020 · 7 comments

Comments

@Beenheed
Copy link

Beenheed commented Mar 9, 2020

Hi FluidTYPO3 team,

i still have issues with accessing page properties or working with pagecontent.
I made a clean new install of Typo3 9.5 () with vhs ("fluidtypo3/vhs": "^6.0") and fluidpages ("fluidtypo3/fluidpages": "^5.0") via composer.
As soon as I add a page I run into

TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection::add() must be an instance of TYPO3\CMS\Backend\View\BackendLayout\BackendLayout, null given, called in /Users/bernhard/Sites/pikatron/pika-test/public/typo3conf/ext/fluidpages/Classes/Backend/BackendLayoutDataProvider.php on line 92

trying to edit page properties and

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: /Users/bernhard/Sites/pikatron/pika-test/public/typo3conf/ext/fluidpages/Resources/Private/Templates/
More information regarding this error might be available online.

if I want to add/edit pagecontents.

The page properties problem I did solve via mentioned changes (#409 ) in ext/fluidpages/Classes/Backend/BackendLayoutDataProvider.php

The main problem was that I am not able to add/edit page contents. After some debugging I stumbled across resolveTemplateFileForControllerAndActionAndFormat() in vendor/typo3fluid/src/View/TemplatePaths.php. In that method
$this->templatePathAndFilename !== null
condition does return an empty stringvalue because $this->templatePathAndFilename is after a clean install just an empty string value and not null.
That leads straight into the 'InvalidTemplateResourceException' from Line 598.
After changing that '$this->templatePathAndFilename !== null' condition into !empty($this->templatePathAndFilename) I can edit the page content like before.

Now I run into the issue, that I am not able to get my Backend Layouts of my extension working. I am not sure if that is because of the Changes in TemplatePaths or if I have problems with my extension. Maybe someone is able to have a look at that condition (Line 254) in TemplatePaths.php and can verify that this is a cause for that

Tried resolving a template file for controller action "Page->default" in format ".html", but none of the paths contained the expected ...

issue.

cheers
Bernhard

@nostadt
Copy link

nostadt commented Mar 11, 2020

Looks like did it not find it's way into the master and latest release yet...

in development branch you find https://github.com/FluidTYPO3/fluidpages/blob/development/Classes/Backend/BackendLayoutDataProvider.php#L89

However, in master: https://github.com/FluidTYPO3/fluidpages/blob/master/Classes/Backend/BackendLayoutDataProvider.php#L88

@Beenheed
Copy link
Author

These changes help me to edit the page properties again,
but i am still not able to edit page content because of those template errors.

Tried resolving a template file for controller action "Page->default" in format ".html"

as is said, what helped with this issue was to edit:
vendor/typo3fluid/src/View/TemplatePaths.php

    public function resolveTemplateFileForControllerAndActionAndFormat($controller, $action, $format = null)
    {
        if (!empty($this->templatePathAndFilename)) {
            return $this->templatePathAndFilename;
        }
        $format = $format ?: $this->getFormat();
        $controller = str_replace('\\', '/', $controller);
        $action = ucfirst($action);
        $identifier = $controller . '/' . $action . '.' . $format;
        if (!array_key_exists($identifier, $this->resolvedFiles['templates'])) {
            $templateRootPaths = $this->getTemplateRootPaths();
            foreach ([$controller . '/' . $action, $action] as $possibleRelativePath) {
                try {
                    return $this->resolvedFiles['templates'][$identifier] = $this->resolveFileInPaths($templateRootPaths, $possibleRelativePath, $format);
                } catch (InvalidTemplateResourceException $error) {
                    $this->resolvedFiles['templates'][$identifier] = null;
                }
            }
        }
        return isset($this->resolvedFiles[self::NAME_TEMPLATES][$identifier]) ? $this->resolvedFiles[self::NAME_TEMPLATES][$identifier] : null;
    }

changing

if ($this->templatePathAndFilename !== null) {
  return $this->templatePathAndFilename;
}

to

if (!empty($this->templatePathAndFilename)) {
  return $this->templatePathAndFilename;
}

i can edit page contents again, but still run into template issues if i check pages in frontend view

@olegkarun
Copy link

olegkarun commented Mar 27, 2020

Have the same issue after update form
TYPO3 9.5.9 - 9.5.14, 9.5.15
fluidpages 4.3.0 - 5.0.0
flux 9.3.2

If parent page has 'tx_fed_page_controller_action' - 'Parent decides' then create new page as child produce this error. But just from the context menu, drag and drop new page work fine instead.

No one code changes form above didn't help. Just got a little different message
Was

(1/1) #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: /home/admin/web/tb/public/typo3conf/ext/fluidpages/Resources/Private/Templates/

Now

1/1) #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 (Page/Default.html). The following paths were checked: /home/admin/web/tb/public/typo3conf/ext/fluidpages/Resources/Private/Templates/

@olegkarun
Copy link

olegkarun commented Mar 30, 2020

The same error with copy -> paste pages. Add new page possible just with drag and drop

@stefanbenten
Copy link

I have the same error on two instances.

@rupasix
Copy link

rupasix commented Apr 6, 2020

@olegkarun Flux 9.3.2 have fluidpages inside so you should remove fluidpages to avoid conflicts.

@Beenheed
Copy link
Author

Beenheed commented Apr 6, 2020

Thanks @rupasix

in that case this issue can be closed. I got everything running now by only installing flux instead of fluidpages.

@Beenheed Beenheed closed this as completed Apr 6, 2020
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

5 participants