Issue Bug Closed

#47359TCA setting subtypes_excludelist has problems with inline elements

Alexander Stehlik 04/18/13, 18:01 updated 10/19/17, 21:37

Description

The problem seems to be the class variable excludeElements in TYPO3\CMS\Backend\Form\FormEngine.

When a palette has an inline record, the function stack looks like:

TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm( )
TYPO3\CMS\Backend\Form\FormEngine->getMainFields( )
TYPO3\CMS\Backend\Form\FormEngine->getPaletteFields( )
TYPO3\CMS\Backend\Form\FormEngine->loadPaletteElements( )
TYPO3\CMS\Backend\Form\FormEngine->getSingleField( )
TYPO3\CMS\Backend\Form\FormEngine->getSingleField_SW( )
TYPO3\CMS\Backend\Form\Element\InlineElement->getSingleField_typeInline( )
TYPO3\CMS\Backend\Form\Element\InlineElement->renderForeignRecord( )
TYPO3\CMS\Backend\Form\Element\InlineElement->renderMainFields( )
TYPO3\CMS\Backend\Form\FormEngine->getMainFields( )
TYPO3\CMS\Backend\Form\FormEngine->getPaletteFields( )
TYPO3\CMS\Backend\Form\FormEngine->loadPaletteElements( )
TYPO3\CMS\Backend\Form\FormEngine->getExcludeElements( )

When the InlineElement class calls getMainFields the excludeElements class variable seem to get overwritten in loadPaletteElements().

I see two possible solutions:

  1. Simple: Use local variables
  2. Implement a cache based on the current table / field

Please let me know which solution you prefer and I will provide a patch.

Reviews 2