Flowplayer 和 Dexterity 投掷错误的组合
我灵活地定义了一个内容类型,其中包含许多 RichText 字段,并且运行良好。然后我将 Collective.flowplayer 添加到我的安装中。这似乎添加了一个适配器,以便它可以检测内容中是否嵌入了音频或视频播放器 div 标签,这一切都是有意义的。但现在我无法编辑或创建我的其中一种敏捷类型的实例。适配器抛出异常,抱怨类型无法适应 IPrimaryFieldInfo,并且无法保存 dexterity 内容类型。
从另一个 SO 问题中获取线索,我从 plone.directives.form.Schema 和 plone.rfc822.interfaces.IPrimaryFieldInfo 中导出了敏捷性内容类型。这次在 Collective.flowplayer.dexterity 的 update_media_info 函数中出现了一个不同的异常,我可以通过更改来解决该异常:
if info.value is not None:
这
if hasattr(info, 'value') and info.value is not None:
对我来说有点太老套了,无法满意。
这是一个已知问题,还是这只是版本控制的噩梦?
I have defined a content type in dexterity that has a number of RichText fields in it, and this was working fine. I then added collective.flowplayer into my install. This seems to add an adapter so that it can detect if content has an audio or video player div tag embeded in it, which all makes sense. But now I can't edit or create an instance of one of my dexterity types. The adapter throws an exception complaining that the type cannot be adapted to IPrimaryFieldInfo, and the dexterity content type cannot be saved.
Taking the clue from another SO question, I derived the dexterity content type from both plone.directives.form.Schema and plone.rfc822.interfaces.IPrimaryFieldInfo. A different exception this time in collective.flowplayer.dexterity's update_media_info function, which I could work around by changing:
if info.value is not None:
to
if hasattr(info, 'value') and info.value is not None:
which is a bit too hacky for me to be happy with.
Is this a known problem, or is this just some versioning nightmare?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论