#47359TCA setting subtypes_excludelist has problems with inline elements
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:
- Simple: Use local variables
- Implement a cache based on the current table / field
Please let me know which solution you prefer and I will provide a patch.