Drupal 页面的"评论设置"和页面上的评论没有显示



我一直在玩注释,制作自定义注释部分和编辑模块。我还在"comments"表中添加了新的数据库列,这样我就可以为不同类型的页面设置不同的评论集。在这个过程中,我想我把模块搞砸了。现在,当我进入任何页面或文章进行编辑时,我没有"评论设置"部分,我可以在其中启用评论。同样,注释不再出现在任何页面上。

可能发生了什么?我该如何解决这个问题?

为特定内容类型配置注释设置:

  1. 导航到内容类型管理页面(管理>结构>内容类型或http://example.com/admin/structure/types)。

  2. 找到要启用的内容类型,点击"编辑"链接

  3. 向下滚动,点击"评论设置"选项卡

  4. 在这里你可以指定几个不同的设置(一些选项将不会出现,直到你选择了某个设置)。


新内容的默认注释设置

该类型未来内容的注释设置默认为:

Hidden: No comments are allowed, and past comments are hidden.
Closed: No comments are allowed, but any past comments remain visible.
Open: Any future content of this type is open to new comments.

注意:这个设置是默认的,并且不能回溯到该类型的现有内容。线程

启用此选项时,评论将显示在线程列表中(回复将缩进以使讨论更容易跟踪)。每页注释

指定在一个页面上显示的最大注释数(如果超过此限制,将添加其他页面)。允许注释标题

当启用该选项时,用户可以为他们的注释填写标题(标题是可选的)。在同一页面上显示回复表单

当启用此选项时,回复表单将显示在与评论相同的页面上。(如未选择此选项,点击"回复"会转到一个新页面,你可在此填写回复表格。)预览评论

你可以指定预览是"必需的"(总是在保存注释之前显示),"禁用的"(从不显示),还是"可选的"(用户可以选择显示预览)。

注意:设置完成后请务必点击"保存内容类型"

在这里,我假设您在注释表中有数据,并且您不希望丢失数据。在执行以下步骤之前,请先备份您的数据库,以便在出现问题时可以进行备份。并将注释表作为独立备份,无问题列。

Step1: Go to module and disable comment module.
Step2: Now uninstall comment module which is in uninstall tab. Now go to db and confirm comment table is deleted. If it is not delete, drop table manually.
Step3: Delete comment folder from core module's folder. 
Step4: Copy fresh comment folder. 
Step5: Now go to module page and enable comment module.
Step6: To debug just create any page and add comment and then verify.
Step7: If it is working, Then drop comment table and restore if from table backup.
Step8: Repeat step6 and verify. 

注意:不建议在生产环境中使用。

注2:我已经在drupal 7.20中尝试过了

最新更新