开发者

Drupal Comment Form Missing

开发者 https://www.devze.com 2023-03-22 00:53 出处:网络
I\'ve inherited a Drupal 6 project and I am in need of a comment form on one of my pages. The module is enabled and the content type is set to allow for comments.

I've inherited a Drupal 6 project and I am in need of a comment form on one of my pages. The module is enabled and the content type is set to allow for comments.

The permissions are set as follows:

  • Anonymous User: Access Comments, Post Comments
  • Authenticated User: Access Comments, Post Comments
  • Content Admin: Access Comments, Administer Comments, Post Comments, Post Comments Without Approval

A link displays below the page contents, "Add new comment." Clicking this link takes me to the URL comment/reply/28#comment-form, which is displaying the same content and nothing new. I believe there should be a form displaying on this page, but I cannot for the life of me figure out what I am missing.

The site is on a custom theme - is there somewhere that I need to make a PHP call to show the form on a page? I searched through a couple of the other themes(that apparently come standard with Drupal) and could find no reference other than comment.tpl.php, which is identical to the one in this custom theme.

EDIT: Per Oswald's suggestion in an answer below, I installed the Theme Developer add-on to try to track down what is going on. The results of going into devel mode on the page in question are as follows:

... (Object) stdClass
nid (String, 2 characters ) 28
type (String, 5 characters ) story
language (String, 0 characters )
uid (String, 1 characters ) 1
status (String, 1 characters ) 1
created (String, 10 characters ) 1311112998
changed (String, 10 characters ) 1311113045
comment (String, 1 characters ) 2
promote (String, 1 characters ) 0
moderate (String, 1 characters ) 0
sticky (String, 1 characters ) 0
tnid (String, 1 characters ) 0
translate (String, 1开发者_JS百科 characters ) 0
vid (String, 2 characters ) 28
revision_uid (String, 1 characters ) 1
title (String, 12 characters ) testimonials
body (String, 2076 characters ) Lorem Ipsum blah blah blah
teaser (String, 554 characters ) Lorem Ipsum blah blah blah
log (String, 0 characters )
revision_timestamp (String, 10 characters ) 1311113045
format (String, 1 characters ) 1
name (String, 8 characters ) blahblahblah
picture (String, 0 characters )
data (String, 72 characters ) a:1:{s:13:"form_build_id";s:37:"form-4fad331ed7...
last_comment_timestamp (String, 10 characters ) 1311112998
last_comment_name (NULL)
comment_count (String, 1 characters ) 0
taxonomy (Array, 0 elements)

The only thing that stood out to me was the data section, the full contents of which are: a:1:{s:13:"form_build_id";s:37:"form-4fad331ed7e2000d316142aaf87c302f";}.

The parents of the page /comment/reply/28#comment-form are theme_markup < node < page. The candidate function names are templatename_markup < phptemplate_markup < theme_markup.


The page template that is used to render the page (usually page.tpl.php) should know a variable called $content. This variable should contain the rendered node and the rendered comment form.

Use the Theme developer module to find out which page template is used to render comment/reply/28#comment-form. Examine that template file to find out whether $content is actually used by the template.


Have you checked the theme's configuration? Some themes have an option to disable the display of the comment form (and other things).


I ended up re-writing the template from the ground up and got the comments working. No explanation as to what was wrong with it initially.


I was working on a site that someone else had put up some years ago and was facing this problem too. After testing with other themes and making sure all the settings were right, I was sure it was a conflict with a module. And it sure was, the original web developer had enabled Commentsblock which disabled the comments on node template and made them available only in a block.

Should have gone through the modules first, that was pretty obvious..

0

精彩评论

暂无评论...
验证码 换一张
取 消