【已解决】user warning: Table ‘XXX.annotations’ doesn’t exist query: SELECT note FROM annotations WHERE nid = XXX AND uid = 1 in XXXsitesallmodulescustomannotate.module on line XXX
【背景】
按照Pro Drupal Development Second Edition (Drupal 6)去学习新建一个annotate的模块,前面都很顺利,但是最后新建一个page,点击save后,出现annotate的时候,结果显示错误:
但是貌似也没有提供解决办法。
2. 后来找到这里:
才提到了具体的原因,至少知道了,当前的代码的函数用错了。
而且该书官网:
http://www.drupalbook.com/errata_overview
variable_delete(‘annotate_node_types’);
variable_del(‘annotate_node_types’);”
对照代码,我的手上的代码,是从:
http://www.17drupal.com/node/141
拷贝过来的,是variable_delete了。
然后去这里:
http://www.drupalbook.com/node/2
下载了官方代码,其中的函数用的是variable_del,的确是工作正常的。
然后经过测试,此处用了错误的variable_delete,机会导致的后面一系列的问题,即:
(1)卸载annotate的时候,也会出现500的网页错误
(2)然后重新去enable这个模块的时候,也无法生成对应的数据库的项
(3)然后创建一个page,去测试annotate的时候,就会出现上面那个“doesn’t exist query”的错误。
转载请注明:在路上 » 【已解决】user warning: Table ‘XXX.annotations’ doesn’t exist query: SELECT note FROM annotations WHERE nid = XXX AND uid = 1 in XXXsitesallmodulescustomannotate.module on line XXX