TYPO3 Neos: Apply content property run in JavaScript error

163 views Asked by At

I try to create a custom node type like the multi columns and the default ContentCollection should be extended with an additionaly property. The backend and frontend view works so far. But if the property span of the ContentCollection is changed, the editor run in a JavaScript timeout error. There are no error or warnings in the console.

The error message:

Warning: Not answering Script

Ein Skript auf dieser Seite ist eventuell beschäftigt oder es antwortet nicht mehr. Sie können das Skript jetzt stoppen, im Debugger öffnen oder weiter ausführen.

Skript: http://domain.com/_Resources/Static/Packages/TYPO3.Neos/JavaScript/ContentModule-built.js:389

To reproduce do following:

Using the site package "TYPO3.NeosDemoTypo3Org". TYPO3 Neos v1.1.2. Create an package "Selector.Test"

Configuration/Settings.yaml

TYPO3:
  Neos:

    typoScript:
      autoInclude:
        'Selector.Test': TRUE

    nodeTypes:
      groups:
        selectorTest:
          label: 'Selector Test'
          position: 10

Configuration/NodeTypes.Columns.yaml

'Selector.Test:RowAbstract':
  abstract: TRUE
  superTypes:
    - 'TYPO3.Neos:Content'
  ui:
    label: 'Columns'
    group: 'selectorTest'
    icon: 'icon-columns'
    inlineEditable: TRUE
    inspector:
      groups:
        columnSettings:
          label: 'Column settings'
          position: 10

# Create a custom ContentCollection
'Selector.Test:ColumnContentCollection':
  superTypes:
    - 'TYPO3.Neos:ContentCollection'
  ui:
    label: 'Column Content Collection'
    icon: 'icon-list'
    inlineEditable: TRUE
    inspector:
      groups:
        columnSpan:
          label: 'Column span'
          position: 10
  properties:
    span:
      type: string
      defaultValue: ''
      ui:
        label: 'Span'
        reloadIfChanged: TRUE
        inspector:
          group: 'columnSpan'

# Define row with custom ContentCollection
'Selector.Test:Row':
  superTypes:
    - 'Selector.Test:RowAbstract'
  childNodes:
    column0:
      type: 'Selector.Test:ColumnContentCollection'
    column1:
      type: 'Selector.Test:ColumnContentCollection'

Resources/Private/TypoScript/Root.ts2

prototype(Selector.Test:Row) < prototype(TYPO3.Neos:Content) {

    templatePath = 'resource://Selector.Test/Private/Templates/NodeTypes/Row.html'

    attributes {
        class = 'row'
    }

    columns = TYPO3.TypoScript:Collection {
        collection = ${q(node).children('[instanceof TYPO3.Neos:ContentCollection]')}
        itemRenderer = Selector.Test:Column
        itemName = 'node'
    }
}

prototype(Selector.Test:Column) < prototype(TYPO3.TypoScript:Template) {

    node = ${node}
    templatePath = 'resource://Selector.Test/Private/Templates/NodeTypes/Column.html'

    attributes = TYPO3.TypoScript:Attributes {
        class.span = ${q(node).property('span') ? q(node).property('span') : null}
    }

    columnContentCollection = TYPO3.Neos:ContentCollection {
        nodePath = '.'
    }
}

Resources/Private/Templates/NodeTypes/Column.html

{namespace ts=TYPO3\TypoScript\ViewHelpers}
<div{attributes -> f:format.raw()}>
    <ts:render path="columnContentCollection" />
</div>

Resources/Private/Templates/NodeTypes/Row.html

{namespace ts=TYPO3\TypoScript\ViewHelpers}
<div{attributes -> f:format.raw()}>
    <ts:render path="columns" />
</div>
1

There are 1 answers

1
Christopher On

This seems to be the problem described in this Jira issue. Unfortunately it was not solved yet, but a preliminary solution exists as an open change (for review): https://review.typo3.org/#/c/31244/

You could try to apply that change to the TYPO3.Neos package and give feedback if it solves your problem, so it can be incorporated in the next Neos release.