从内联<flux:form options = {...}>迁移到<flux:form.option* />时发生焊剂错误

问题描述

问题

我收到以下错误,但不知道为什么或如何解决

Call to undefined method FluidTYPO3\Flux\Form\Container\Sheet::setOption()

在尝试禁用fluidpages并升级flux 9.4后,我试图使一切正常。我想我已经正确完成了数据库更新。我正在使用:typo3 8.7,flux 9.4,否fluidcontent,否fluidpagesvhs

注意:这也交叉发布在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" />

其他参考

有些事情可能会有所帮助,而且我可能会误会了,因此我的网站无法正常工作

解决方法

感谢@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

的图标

ProgressBar.png

注意:我在上面的代码中将fluidbootstraptheme提取为yourextension,这使得在您的特定情况下要替换的内容更加明显。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...