Drupal 7 开发内部培训资料, 分头诗人

relation relation_add使用问题

赞成!
0
否决!

使用relation relation_add模块,使用区块添加关联成功,使用字段形式添加关联,发布内容时候出现错误提示。

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {relation} (rid, relation_type, vid, uid, created, changed, arity) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => product_product [:db_insert_placeholder_2] => 2 [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 1416302377 [:db_insert_placeholder_5] => 1416302377 [:db_insert_placeholder_6] => 2 ) in drupal_write_record() (line 7202 of D:\wamp\www\shop\includes\common.inc).

1 个回答

赞成!
0
否决!

这种很可能是模块本身的bug,最好是先去模块那边提交issue,向作者求助,让作者修复这个bug。

同时要检查是否有版本升级过,而没运行 update.php