跳转到主要内容
Jerry1983 提交于 20 January 2013

在下边读《Pro Drupal 7 Development》边做试验。在第二章annotate模块中调试annotate.install发现问题。就是field_create_field($field)函数可以创建 annotate字段,该字段可以在node里面显示,但是下面这段代码貌似没有起作用:

 

  $types = node_type_get_types();   foreach($types as $type) {     annotate_delete_annotation($type);   }     $field = field_info_field('annotation');   if ($field) {     field_delete_field('annotation');   }   没有删除我留下的注释,是哪里写错了吗?

后台LOG:

 

系统 01/20/2013 - 10:47 annotate 模块禁用。 jlzhang1983
Annotation 01/20/2013 - 10:46 Added annotation field to content type: page jlzhang1983
Annotation 01/20/2013 - 10:46 Added annotation field to content type: article jlzhang1983
本地 01/20/2013 - 10:46 更新了 Chinese, Simplified(简体中文) 语言的JavaScript翻译文件。 jlzhang1983
系统 01/20/2013 - 10:45 annotate 模块已启用。 jlzhang1983
系统 01/20/2013 - 10:45 annotate 模块已安装。 jlzhang1983
 
是不是我的uninstall函数没有被调用?函数里面的watchdog('Annotate Module', 'Uninstalling module and deleting fields');这句没有执行吧,要不然会显示在log里吧?