使用" DisplayLogicWrapper :: create"时,我在SilverStripe中出现重复错误。它无论是上传字段还是网格字段或其他任何问题都是同样的问题。任何帮助表示赞赏!
PHP 5.6.30,silverstripe / cms 3.5.3,unclecheese / display-logic 1.5 插件:https://github.com/unclecheese/silverstripe-display-logic/tree/1.5.0#dealing-with-non-standard-form-fields
private static $has_one = array(
'IntroBackgroundIMG' => 'Image',
);
DisplayLogicWrapper::create(
UploadField::create('IntroBackgroundIMG', 'Background Image'))
->displayIf("BackgroundType")->isEqualTo("img")
->end(),
收到错误:
[User Error] collateDataFields() I noticed that a field called
'IntroBackgroundIMG' appears twice in your form: '(unknown form)'. One is a
'UploadField' and the other is a 'UploadField'
答案 0 :(得分:1)
我不熟悉这个模块,但看起来你试图有条件地显示UploadField,在这种情况下你可能需要确保首先删除自动搭建的默认UploadField:
onBackpressureLatest