TYPO3 14.2扩展插件选项在记录编辑页面不显示问题排查
问题背景
扩展在TYPO3 13及更早版本运行正常,适配TYPO3 14后可正常加载,但后端记录编辑页面的「Plugin」标签页(对应扩展参数配置)未显示(TYPO3 12/13版本中正常显示),日志无报错信息。
已完成的适配操作
已将ext_localconf.php中的PageTSConfig代码迁移至Configuration/page.tsconfig:
原ext_localconf.php代码
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( 'mod { wizards.newContentElement.wizardItems.plugins { elements { gpcfphpscriptwrapper { iconIdentifier = gpcf_phpscript_wrapper-plugin-gpcfphpscriptwrapper title = LLL:EXT:gpcf_phpscript_wrapper/Resources/Private/Language/locallang_db.xlf:tx_gpcf_phpscript_wrapper_gpcfphpscriptwrapper.name description = LLL:EXT:gpcf_phpscript_wrapper/Resources/Private/Language/locallang_db.xlf:tx_gpcf_phpscript_wrapper_gpcfphpscriptwrapper.description tt_content_defValues { CType = list list_type = gpcfphpscriptwrapper_gpcfphpscriptwrapper } } } show = * } }' );
迁移至Configuration/page.tsconfig的代码
mod.wizards.newContentElement.wizardItems.plugins { elements.gpcfphpscriptwrapper { iconIdentifier = gpcf_phpscript_wrapper-plugin-gpcfphpscriptwrapper title = LLL:EXT:gpcf_phpscript_wrapper/Resources/Private/Language/locallang_db.xlf:tx_gpcf_phpscript_wrapper_gpcfphpscriptwrapper.name description = LLL:EXT:gpcf_phpscript_wrapper/Resources/Private/Language/locallang_db.xlf:tx_gpcf_phpscript_wrapper_gpcfphpscriptwrapper.description tt_content_defValues { CType = list list_type = gpcfphpscriptwrapper_gpcfphpscriptwrapper } } show = * }
当前FlexForms配置
Configuration/FlexForms/flexform_main.xml内容:
<?xml version="1.0"?> <T3DataStructure> <sheets> <sDEF> <ROOT> <sheetTitle>Options</sheetTitle> <type>array</type> <el> <settings.script> <label>Path</label> <config> <type>input</type> <size>30</size> <eval>string</eval> <default></default> </config> </settings.script> <settings.group> <label>Group</label> <config> <type>input</type> <size>30</size> <eval>string</eval> <default></default> </config> </settings.group> </el> </ROOT> </sDEF> </sheets> </T3DataStructure>
排查方向
验证FlexForm注册的正确性:检查
Configuration/TCA/Overrides/tt_content.php中是否正确关联FlexForm,确保list_type与插件标识完全一致:$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['gpcfphpscriptwrapper_gpcfphpscriptwrapper'] = 'pi_flexform'; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( 'gpcfphpscriptwrapper_gpcfphpscriptwrapper', 'FILE:EXT:gpcf_phpscript_wrapper/Configuration/FlexForms/flexform_main.xml' );同时确认
ext_localconf.php中configurePlugin的参数配置无错误,特别是插件类型、控制器映射部分。检查PageTSConfig是否生效:在后端「模板」模块查看PageTSConfig加载情况,确认迁移后的配置已被正确读取。可临时在页面属性的「资源」标签手动添加该配置,测试是否能恢复标签页显示。
核对TCA配置变更:对比News扩展的
Configuration/TCA/Overrides/tt_content.php配置,检查TYPO3 14对tt_content的list类型插件是否有新增要求,比如showitem字段调整、标签页显示控制的新配置项。清理缓存并强制刷新:清理TYPO3所有缓存(配置缓存、页面缓存),然后用
Ctrl+F5强制刷新后端页面,排除缓存导致的配置未生效问题。排查语言文件问题:将FlexForm中的
sheetTitle改为硬编码文本(如Test Options),测试标签页是否显示,排除语言文件路径或键名错误导致的渲染隐藏。查看浏览器控制台报错:打开浏览器开发者工具(F12),检查控制台是否有JS/CSS加载错误,这类问题可能导致标签页渲染失败。
对比News扩展的配置差异:下载TYPO3 14版本的News扩展,逐一对比插件注册、FlexForm关联、TCA配置等环节的差异,定位遗漏的适配点。
内容的提问来源于stack exchange,提问作者oheil

