Need Help Tracking Cause Of Missing Comment Submission Form

MBR - June 30, 2009 - 17:27

Although I have a specific problem I'm trying to solve right now (see http://drupal.org/node/502636), I have a larger question about how Drupal administrators go about tracking down problems when Drupal misbehaves. I'm posting this here because, out of all the forums, this forum seems to be the only one where software developers might congregate.

As a programmer, I'm used to being able to zero in on the cause of a problem by stepping through the code. But that can be very labor-intensive, especially if it's a large body of code like Drupal that I'm unfamiliar with. My impression is that, if you're not a programmer, the only available approach is to carefully examine all the settings under "Administer", and if you can't solve the problem that way, throw your hands up in despair. Can that really be the case?

Also, can anyone here give me any pointers to where in the code I should start looking if I want to track down the cause of the problem I've described in detail at http://drupal.org/node/502636? The quick summary of the problem is that the comment submission form doesn't display, and I've double- and triple-checked every setting I can think of in the "Administer" menu tree.

_

WorldFallz - June 30, 2009 - 19:25

Frankly most developers don't frequent the forums-- so posting here probably won't help in that respect and may actually work against you since the other forums probably see more traffic.

First, see:

Documentation -> Troubleshooting FAQ -> How to troubleshoot (read this first)

I'm no 'developer', more of a code jockey really, but here some things I always do/recommend when troubleshooting:

  • if there's an error message i can relate to a specific module:
    1. i browse the module's issue queue for anything possibly related.
    2. If that turns up empty, I'll search d.o with enough of the string to narrow down the results without being too specific so as to eliminate possible posts.
    3. Try and troubleshoot myself (using lots of print and print_r statements), if solved, post a patch to the module's issue queue.
    4. If that fails I'll post a new issue to the issue queue.
  • If there's an error message that seems to point to core drupal:
    1. Similar to above, I'll browse the drupal issue queue and if that turns up empty i'll search d.o. If that turns up empty I usually also try a more generic google search with 'drupal' as one of the keywords.
    2. If that fails I'll disable (not uninstall) all contributed modules (contrib_toggle can be very helpful here). If the problem goes away, i'll enable modules one by one until I find the culprit and then proceed as listed above.
    3. Attempt to troubleshoot myself and post a patch to the drupal issue queue if possible.
    4. If the problem persists with only drupal core and there are no similar issues I'll would create a new one (i don't think i've ever had to do this yet).
  • For incorrect behavior with no obvious error message, I always check the logs (admin/reports/dblog for drupal, as well as the apache and php logs if possible).
  • i try changing browsers and/or computers.
  • I do most of my dev on a linux based shared hosting account-- occasionally i've tried to replicate problems locally on a windows box (or vice versa depending on where the problem appears).
  • I have also occasionally fixed problems by clearing both the drupal cache (admin/settings/performance) and browser cache repeatedly.

That's about it-- I don't think I've ever had to do anything else. Also note, both the devel and contrib_toggle modules can be useful for troubleshooting. There's also http://drupal.org/irc.

In this particular case, I would first try turning off all contrib modules. If you still can't get the comment form to appear try displaying it manually in a php page with:

<?php
print drupal_get_form('comment_form', array('nid' => arg(1)), t('Post new comment'));
?>

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

What to include()/require()

MBR - June 30, 2009 - 22:08

Thanks for your help.

WRT the code you suggested:

<?php
print drupal_get_form('comment_form', array('nid' => arg(1)), t('Post new comment'));
?>

I haven't yet started reading the manual on how to write a Drupal module. So, it would be a big help if you could tell me what files I need to include() or require() to make your suggested test work.

_

WorldFallz - July 1, 2009 - 14:32

Sorry, I should have been more explicit. You don't need to include anything-- just create a page (at node/add/page), set the input format to "php code" (if you don't have that option enable the 'php code' core module), and place the code in the body.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Comment Settings

thesubtledoctor - July 24, 2009 - 20:41

When you edit the content type, under 'Comment Settings', be sure that the setting for 'Location of comment submission form' is 'Display below post or comments'.

 
 

Drupal is a registered trademark of Dries Buytaert.