Call to a member function getContextPath() on null and NO IDEA WHY

Hey guys,

sorry if this is a stupid question but I dont know what I can do.

Alway when I want to add an Text-Element to a page I got this Server Error:

Call to a member function getContextPath() on null

Error thrown in file

~/xy/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Neos_Service_Controller_NodeController.php in line 420

I have no idea what may be the problem at all …

This is my Root.ts2:

/**
 * Root TypoScript template for the xy.xy site
 */

prototype(XYSidebarElement) < prototype(TYPO3.Neos:Content) {
    templatePath = 'resource://XY.xy/Private/Templates/TypoScriptObjects/SidebarElement.html'
    content = ${q(node).property('content')}
    headline = ${q(node).property('headline')}
    link = ${Neos.Link.resolveNodeUri(q(node).property('link'), q(node).get(0), this.tsRuntime.controllerContext)}
}

page = Page {
    head {
        stylesheets.site = TYPO3.TypoScript:Template {
            templatePath = 'resource://XY.xy/Private/Templates/Page/Default.html'
            sectionName = 'stylesheets'
        }

        javascripts.site = TYPO3.TypoScript:Template {
            templatePath = 'resource://XY.xy/Private/Templates/Page/Default.html'
            sectionName = 'headScripts'
        }
        metadata = TYPO3.TypoScript:Template {
            templatePath = 'resource://XY.xy/Private/Templates/Page/Default.html'
            sectionName = 'metadata'
        }
    }

    body {
        templatePath = 'resource://XY.xy/Private/Templates/Page/Default.html'
        sectionName = 'body'
        content_image = ${q(node).property('contentImage') ? q(node).property('contentImage') : q(node).parent('[contentImage != ""]').property('contentImage')}
        has_sidebar = ${q(node).property('hasSidebar')}
        is_live = ${neos:rendering.inBackend()}

        parts {
            main_menu =  TYPO3.Neos:Menu {
                templatePath = 'resource://XY.xy/Private/Templates/TypoScriptObjects/MainMenu.html'
                current.attributes.class = 'active'
            }

            header_menu =  TYPO3.Neos:Menu {
                templatePath = 'resource://XY.xy/Private/Templates/TypoScriptObjects/HeaderMenu.html'
                current.attributes.class = 'active'
                startingPoint = ${q(site).children('[uriPathSegment="kopfmenu"]').get(0)}
                entryLevel = 2
                maximumLevels = 1

                language_menu = TYPO3.Neos:DimensionMenu {
                    templatePath = 'resource://XY.xy/Private/Templates/TypoScriptObjects/LanguageMenu.html'
                    dimension = 'language'
                }

            }

            footer_menu =  TYPO3.Neos:Menu {
                templatePath = 'resource://XY.xy/Private/Templates/TypoScriptObjects/FooterMenu.html'
                current.attributes.class = 'active'
                startingPoint = ${q(site).children('[uriPathSegment="fussmenu"]').get(0)}
                entryLevel = 2
                maximumLevels = 1
            }

            footer = TYPO3.Neos:ContentCollection {
                nodePath = ${q(site).find('footer').property('_path')}
                collection = ${q(site).children('footer').children()}
            }
        }
        // These are your content areas, you can define as many as you want, just name them and the nodePath.
        content {
            breadcrumb = TYPO3.Neos:BreadcrumbMenu
            // The default content section
            main = PrimaryContent {
                nodePath = 'main'
            }

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

        share_list {
            urls {
                twitter = ''
                facebook = ''
                youtube = ''
                google_plus = ''
                share = ''
            }
        }

        javascripts.site = TYPO3.TypoScript:Template {
            templatePath = 'resource://XY.xy/Private/Templates/Page/Default.html'
            sectionName = 'bodyScripts'
        }
    }
}

NodeTypes:

# If you need more than just the "main" content area you can uncomment the snippet below. It will add a "sidebar" area
# to your pages. You can add as many areas as you like, still only those that are rendered in your TypoScript and
# Template are visible on your page.
# 
---

'XY:SidebarElement':
  superTypes:
    'TYPO3.Neos:Content': TRUE
  ui:
    label: 'Sidebar Element'
    group: 'general'
    position: 1
    icon: 'icon-file-alt'
    inspector:
      groups:
        document:
          label: 'Link'
  properties:
    content:
      type: string
      defaultValue: 'Inhalt'
      ui:
        label: 'Inhalt'
        inlineEditable: TRUE
    headline:
      type: string
      defaultValue: ''
      ui:
        label: 'Überschrift'
        inlineEditable: TRUE
    link:
      type: string
      ui:
        inspector:
          group: 'document'
          editor: 'TYPO3.Neos/Inspector/Editors/LinkEditor'
          editorOptions:
            assets: TRUE
            nodeTypes: ['TYPO3.Neos:Shortcut','TYPO3.Neos:Document']
            placeholder: 'URL, Seitenname oder Ressourcenname'
'TYPO3.Neos.NodeTypes:Page':
  ui:
    inspector:
      groups:
        contentImage:
          label: 'Titelbild'
          position: 900
        sidebar:
          label: 'Sidebar'
          position: 1000
  constraints:
    nodeTypes:
      '*': TRUE
      'XY:SidebarElement': FALSE
  properties:
    contentImage:
      type: TYPO3\Media\Domain\Model\ImageInterface
      ui:
        label: 'Bild'
        reloadPageIfChanged: TRUE
        inspector:
          group: 'contentImage'
        aloha:
            'table': []
    hasSidebar:
      type: boolean
      defaultValue: TRUE
      ui:
        label: 'Display sidebar?'
        reloadIfChanged: TRUE
        inspector:
          group: 'sidebar'
  childNodes:
    'footer':
      label: 'Webseitenfuß'
      position: 'end'
      type: 'TYPO3.Neos:ContentCollection'
      constraints:
        nodeTypes:
          'TYPO3.Neos.NodeTypes:Text': TRUE
          'TYPO3.Neos.NodeTypes:Image': TRUE
          '*': FALSE
    'sidebar':
      type: 'TYPO3.Neos:ContentCollection'
      constraints:
        nodeTypes:
          '*': FALSE
          'XY:SidebarElement': TRUE
'XY.MainSite:NewsArticlePage':
  superTypes:
    'TYPO3.Neos:Document': true
  ui:
    label: 'News Artikel'
  childNodes:
    'main':
      type: 'TYPO3.Neos:ContentCollection'

Has anyone debug suggestions?
I am despairing…

Hi Marv,

I’d suggest simply eliminate complexity until it starts working and work your way back from that.

Also there must be more of a stack trace to help you out.

Hi marvvv,
i had the same problem before few days.
Perhaps it is the same problem.

On page child nodes the Plus button is in “Add after that” mode, but the element must be inserted into the collection. So you look for the “plus” button.
The backend is not working correctly. In previous versions the After that mode is disabled, now all modes are enabled.

If I delete the constraints of the Page everything works. But why ?!