问题描述
问题
我收到以下错误,但不知道为什么或如何解决
Call to undefined method FluidTYPO3\Flux\Form\Container\Sheet::setOption()
在尝试禁用fluidpages
并升级flux
9.4后,我试图使一切正常。我想我已经正确完成了数据库更新。我正在使用:typo3
8.7,flux
9.4,否fluidcontent
,否fluidpages
,vhs
。
注意:这也交叉发布在TYPO3的Flux
Slack频道中,如果需要,可以更长时间地进行实时对话。
我的代码
这是我以前在fluidbootstraptheme/Resources/Private/Templates/Content/Carousel.html
<f:section name="Configuration">
<flux:form id="carousel" options="{group: 'Bootstrap',sorting: 200,icon: 'EXT:fluidbootstraptheme/Resources/Public/Icons/Content/Carousel.png'}">
这就是我现在在fluidbootstraptheme/Resources/Private/Templates/Content/Carousel.html
<f:section name="Configuration">
<flux:form id="carousel">
<flux:form.option.group value="Bootstrap" />
<flux:form.option.sorting value="200" />
<flux:form.option.icon value="EXT:fluidbootstraptheme/Resources/Public/Icons/Content/Carousel.png" />
其他参考
有些事情可能会有所帮助,而且我可能会误会了,因此我的网站无法正常工作
- https://www.aemka.de/en/news/update-from-extflux-8-to-9.html
- https://www.aemka.de/en/news/fluid-pages-page-layouts-without-fluidpages.html
- https://github.com/FluidTYPO3/flux/issues/1542
解决方法
感谢@Claus Due,他指出,在我的一个文件中,我不小心将flux:form.option
放置在flux:form.sheet
内,而不是直接放置在flux:form
内。将来他也很added code to check for this specific error in Flux。
错误的方式
<f:section name="Configuration">
<flux:form id="progressBar">
<flux:form.sheet name="progressBar">
<flux:form.option.group value="Bootstrap" />
<flux:form.option.sorting value="650" />
<flux:form.option.icon value="EXT:yourextension/Resources/Public/Icons/Content/ProgressBar.png" />
<flux:field.checkbox name="settings.progressBarAnimated" default="0" />
<flux:field.checkbox name="settings.progressBarStriped" default="0" />
<flux:field.select name="settings.progressBarColor"
正确的方法
<f:section name="Configuration">
<flux:form id="progressBar">
<flux:form.option.group value="Bootstrap" />
<flux:form.option.sorting value="650" />
<flux:form.option.icon value="EXT:yourextension/Resources/Public/Icons/Content/ProgressBar.png" />
<flux:form.sheet name="progressBar">
<flux:field.checkbox name="settings.progressBarAnimated" default="0" />
<flux:field.checkbox name="settings.progressBarStriped" default="0" />
<flux:field.select name="settings.progressBarColor"
如何改善上述代码
@Claus Due还指出,如果使用特殊约定,通常不需要使用flux:form.option.icon
。
将与内容/页面模板关联的任何图标文件复制到“资源/公共/图标/内容”或“资源/公共/图标/页面”,并像命名页面/内容模板一样命名它们。然后从表单中删除“图标”选项
因此对于文件typo3conf/ext/yourextension/Resources/Private/Templates/Content/ProgressBar.html
中的这段代码,我省略了图标行...
<f:section name="Configuration">
<flux:form id="progressBar">
<flux:form.option.group value="Bootstrap" />
<flux:form.option.sorting value="650" />
<flux:form.sheet name="progressBar">
<flux:field.checkbox name="settings.progressBarAnimated" default="0" />
<flux:field.checkbox name="settings.progressBarStriped" default="0" />
<flux:field.select name="settings.progressBarColor"
...,只需确保添加一个专门位于并命名为typo3conf/ext/yourextension/Resources/Public/Icons/Content/ProgressBar.png
注意:我在上面的代码中将fluidbootstraptheme
提取为yourextension
,这使得在您的特定情况下要替换的内容更加明显。