Orchard CMS 1.8.1 - Migrations WithSetting 不保存
Orchard CMS 1.8.1 - Migrations WithSetting not saving
我遵循了我创建的所有示例并且 none 有效。
我的代码(在Migrations.cs)
.WithField("PeopleText", f => f
.OfType("TextField")
.WithDisplayName("People / Team"))
//TODO: Not sure why these settings not taking effect!
.WithSetting("TextFieldSettings.Flavor", "Html")
.WithSetting("TextFieldSettings.Required", "true")
None 以上 2 个设置已保存
我不确定这是 1.8.1 版的已知错误还是我做错了什么?
干杯,
休
您即将关闭字段迁移,这会导致 .WithSetting
链接到部件而不是字段:
.WithField("PeopleText", f => f
.OfType("TextField")
.WithDisplayName("People / Team")) // <-- here you close your field chain, so everything after this will attach to the part chain
如果您将其更改为以下内容,它将起作用:
.WithField("PeopleText", f => f
.OfType("TextField")
.WithDisplayName("People / Team")
.WithSetting("TextFieldSettings.Flavor", "Html")
.WithSetting("TextFieldSettings.Required", "true")) // Close field chain here
我遵循了我创建的所有示例并且 none 有效。
我的代码(在Migrations.cs)
.WithField("PeopleText", f => f
.OfType("TextField")
.WithDisplayName("People / Team"))
//TODO: Not sure why these settings not taking effect!
.WithSetting("TextFieldSettings.Flavor", "Html")
.WithSetting("TextFieldSettings.Required", "true")
None 以上 2 个设置已保存
我不确定这是 1.8.1 版的已知错误还是我做错了什么?
干杯,
休
您即将关闭字段迁移,这会导致 .WithSetting
链接到部件而不是字段:
.WithField("PeopleText", f => f
.OfType("TextField")
.WithDisplayName("People / Team")) // <-- here you close your field chain, so everything after this will attach to the part chain
如果您将其更改为以下内容,它将起作用:
.WithField("PeopleText", f => f
.OfType("TextField")
.WithDisplayName("People / Team")
.WithSetting("TextFieldSettings.Flavor", "Html")
.WithSetting("TextFieldSettings.Required", "true")) // Close field chain here