放牧代码和思想
专注自然语言处理、机器学习算法
    愛しさ 優しさ すべて投げ出してもいい

解决FieldException: Attempt to create an instance of a field annotation

最近在看Pro Drupal 7 Development.pdf的过程中,发现了一个问题。那就是编写第一个模块annotate的时候,抛出异常:FieldException: Attempt to create an instance of a field annotation that doesn't exist or is currently inactive。

原因是在未保存annotate.install的情况下测试了模块。annotate.install里面的function annotate_install ()函数没有被执行,导致字段annotation没有被创建,所以发生了错误。

解决方法如下:

  1. 保存annotate.install

  2. 禁用annotate模块,Drupal的模块必须先禁用再卸载

  3. 卸载annotate模块:

  4. 安装annotate模块,并且启用:

知识共享许可协议 知识共享署名-非商业性使用-相同方式共享码农场 » 解决FieldException: Attempt to create an instance of a field annotation

评论 欢迎留言

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

我的作品

HanLP自然语言处理包《自然语言处理入门》