[SOLVED] Any Debug suggestions?

I tryed to add new page types. An now I have this error:

Catchable Fatal Error: Object of class TYPO3\Flow\Persistence\Doctrine\Proxies\__CG__\TYPO3\Media\Domain\Model\Image could not be converted to string in Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_TypoScript_TypoScriptObjects_ArrayImplementation.php line 40

And I have NO idea how to debug this message.

1 Like

Hi guys

now I have more informations to this bug.

If I add an contentImage to my new custom page-type NewsArticlePage, I got this error from above.

And I have a second problem. This custom page-type also add this output between the head and body tag:

resource://XY.xy/Private/Templates/NodeTypes/NewsArticlePage.htmlTest 123test1

(Test 123 was my page title, but this resource doese not exist)

Here is my config:

Root.ts2

include: NodeTypes/*
include: Documents/*

page = XY:xy:Page

root.newsAritcle {
    condition = ${q(documentNode).is('[instanceof XY:xy:NewsArticlePage]')}
    renderPath = '/newsArticle'
}

newsArticle = XY:xy:NewsArticlePage

Documents/DefaultPage.ts2

prototype(XY:xy:Page) < prototype(TYPO3.Neos:Page) {
    head {
        metadata = TYPO3.TypoScript:Template {
            templatePath = 'resource://XY:xy/Private/Templates/Page/Default.html'
            sectionName = 'metadata'
        }
    }

    body {
        titleImage = TYPO3.Neos:ImageUri {
            asset = ${q(node).property('contentImage') ? q(node).property('contentImage') : q(node).parent('[contentImage != ""]').property('contentImage')}
            maximumWidth = 1200
        }
        templatePath = 'resource://XY:xy/Private/Templates/Page/Default.html'
        sectionName = 'body'

        parts {
            title = ${documentNode.properties.title}
            main_menu = XY:xy:MainMenu
            header_menu = XY:xy:HeaderMenu
            footer_menu =  XY:xy:FooterMenu

            footer = TYPO3.Neos:ContentCollection {
                nodePath = ${q(site).find('footer').property('_path')}
                collection = ${q(site).children('footer').children()}
            }
        }

        content {
            breadcrumb = TYPO3.Neos:BreadcrumbMenu
            sidebar = XY:xy:SidebarItemArray 
            // The default content section
            main = PrimaryContent {
                nodePath = 'main'
            }
        }
    }
}

Documents/NewsArticlePage.ts2

prototype(XY:xy:NewsArticlePage) < prototype(XY:xy:Page) {
     body.templatePath = 'resource://XY:xy/Private/Templates/Page/NewsArticle.html'
     body.parts.title = ${'Lorem: ' + Date.format(q(documentNode).property('articleDate'), 'd.m.Y') }
}

NodeTypes.yaml

'TYPO3.Neos.NodeTypes:Page':
....
    properties:
        contentImage:
            type: TYPO3\Media\Domain\Model\ImageInterface
            ui:
                label: 'Contentimage'
                reloadPageIfChanged: true
                inspector:
                  group: 'contentImage'

EDIT: If I add a articleDate to the NewsArticlePage this error is shown:

Catchable Fatal Error: Object of class DateTime could not be converted to string in /home/marv/Projects/business/erxleben/khporz_relaunch_2016_v2_2/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_TypoScript_TypoScriptObjects_ArrayImplementation.php line 40

EDIT2: I think that output between the head and body tag is the problem. I dont understand why a prototype of a page with no adujstments adds this output :frowning:

1 Like

FYI: Moved topic from the Flow App Development category and removed topic prefx

@marvvvv hard to tell (for me) but it seems you try to render the image or DateTime directly in your template. I’d try to slim down the template until the error is gone in order to find the root cause

Yes but I dont understand why. He tries to render my page properties but only of the NewsArticlePage.

Xy:xy:Page renders complete normal and XY:xy:NewsArticlePage with this additional output. I cant understand this behavior.

PS: Thanks for prefixing my topics =)

Hey marvvvv,
are there any news on this topic? I am at the same strange sitation right now.
thanks

I think I know the problem…

XY:xy:NewsArticlePage is also a NodeType I assume?

before doing prototype(XY:xy:NewsArticlePage) < prototype(XY:xy:Page)
add a prototype(XY:xy:NewsArticlePage) >

And see if that helps.

3 Likes

:grinning: thank a lot, now it works

Fixed my problem too =)!