Describe the bug
I have a backend layout that restricts content using the new setting allowedContentTypes.
I’m trying to create a nested content element (an accordion), but when I save it, I get an error saying that the CType is not allowed. I seam to not be able to overwrite the backend layout setting allowedContentTypes with allowedRecordTypes.
To Reproduce
Steps to reproduce the behavior:
- Create a backend layout and a page that is using this backend layout
mod.web_layout.BackendLayouts.default {
title = Default
config {
backend_layout {
colCount = 1
rowCount = 1
rows {
0 {
columns {
1 {
name = Main
colPos = 0
identifier = main
allowedContentTypes := addToList(fv_accordion)
allowedContentTypes := addToList(div)
allowedContentTypes := addToList(shortcut)
}
}
}
}
}
}
}
- Create the Content Element
Config.yaml
name: fv/accordion
typeName: fv_accordion
group: fv
prefixFields: true
prefixType: vendor
vendorPrefix: tx_basis
fields:
- identifier: accordion_item
type: Collection
minitems: 1
fields:
- identifier: headline
type: Text
required: true
- identifier: content
type: Collection
foreign_sortby: sorting
foreign_table: tt_content
shareAcrossFields: true
shareAcrossTables: true
allowedRecordTypes:
- text
- div
backend-preview.html
<f:layout name="Preview"/>
<f:section name="Header">
</f:section>
<f:section name="Content">
<f:for each="{data.accordion_item}" as="item">
<h3>{item.headline}</h3>
<f:render partial="PageLayout/Grid" arguments="{data: item, identifier: 'content'}"/>
</f:for>
</f:section>
- Got to the created page and insert the content element
- Try to create a content from type text
- Save the Content Element
- See Error: This action could not be completed; please contact your administrator. Technical details: 1: The record "tt_content:174" with CType "text" in colPos "0" couldn't be saved due to disallowed value(s).
- When I delete the allowedContentTypes in the backend layout or change the colPos to something different then 0, everything is working as expected.
Expected behavior
I can save the content and see the related content element in the backend preview. The setting allowedRecordTypes is overwriting the setting allowedContentTypes for this element correctly.
TYPO3 Version
v14.2
also in v13.4 with content_defender extension/syntax
Content Blocks Version:
2.2
Describe the bug
I have a backend layout that restricts content using the new setting allowedContentTypes.
I’m trying to create a nested content element (an accordion), but when I save it, I get an error saying that the CType is not allowed. I seam to not be able to overwrite the backend layout setting allowedContentTypes with allowedRecordTypes.
To Reproduce
Steps to reproduce the behavior:
Config.yaml
backend-preview.html
Expected behavior
I can save the content and see the related content element in the backend preview. The setting allowedRecordTypes is overwriting the setting allowedContentTypes for this element correctly.
TYPO3 Version
v14.2
also in v13.4 with content_defender extension/syntax
Content Blocks Version:
2.2