Forum OpenACS Q&A: Another question... display of general comments.

I have a problem in displaying comments. In the TCL I set the
variable comments_html

# Get comments
if {$general_comments} {
  set comments_html [general_comments_get_comments -print_content_p
1 -print_attachments_p 1 $document_id]
}
In the ADP I call then:
  <if @general_comments@ eq 1>
    <HR NoShade Size=1>
    <table border=0>
      <tr>
        <td>
          <if @comments_html@ not nil>
            <h4>@num_comments@ Comments</h4>
            <blockquote>
            @comments_html@
            </blockquote>
          </if>
          <center><a href="@comment_add_url@">Add a
comment</a></center>
        </td>
      </tr>
    </table>
  </if>

But I don't see the comment. You can see a sample document here,
where one comment is approved:

http://193.81.242.28:8000/doc/6250

The Database for that example looks like the following:

unido=# select * from general_comments where object_id = 6250;
comment_id | object_id | category
------------+-----------+----------
      6865 |      6250 |
      6470 |      6250 |
(2 rows)

and the general_comments table

unido=# SELECT * from general_comments where object_id = 6250;
comment_id | object_id | category
------------+-----------+----------
      6865 |      6250 |
      6470 |      6250 |
(2 rows)

The general_objects table looks like (but I think I don't need that,
or?

unido=# SELECT * from general_objects;
object_id | on_which_table | on_what_id
-----------+----------------+------------
(0 rows)

Thanxs for suggestions!

I put
# Get comments
if {$general_comments} {
   ns_log notice "XXXXXXXXXXXX setting comments XXXXXXXXXXXXXXX"
   set comments_html [general_comments_get_comments -print_content_p 
1 -print_attachments_p 1 $document_id]
}
and the logs look like the following:
[17/Oct/2002:20:08:45][18975.4101][-conn1-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1
[17/Oct/2002:20:08:46][18975.4101][-conn1-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1
[17/Oct/2002:20:08:51][18975.10529802][-sched:9-] Notice: Running scheduled proc acs_mail_lite::sweeper...
[17/Oct/2002:20:08:51][18975.10529802][-sched:9-] Notice: Done running scheduled proc acs_mail_lite::sweeper.
[17/Oct/2002:20:08:53][18975.10530826][-sched:18-] Notice: Running scheduled proc notification::sweep::sweep_notifications...
[17/Oct/2002:20:08:53][18975.10530826][-sched:18-] Notice: Done running scheduled proc notification::sweep::sweep_notifications.
[17/Oct/2002:20:08:53][18975.10531851][-sched:15-] Notice: Running scheduled proc notification::reply::sweep::scan_all_replies...
[17/Oct/2002:20:08:53][18975.10531851][-sched:15-] Notice: NOTIF- scan_all_replies starting
[17/Oct/2002:20:08:53][18975.10531851][-sched:15-] Notice: NOTIF- scan_all_replies deliv method 3101
[17/Oct/2002:20:08:53][18975.10531851][-sched:15-] Notice: NOTIF-EMAIL: about to load qmail queue
[17/Oct/2002:20:08:53][18975.10531851][-sched:15-] Notice: queue dir = /new/*, no messages
[17/Oct/2002:20:08:53][18975.10531851][-sched:15-] Notice: Done running scheduled proc notification::reply::sweep::scan_all_replies.
So I don't really get there...
... found a solution to that. The problem was that in the tcl file a return statement was called above. So I just put it on top
Hey, that log trace reminds me, the log message there about
what charset encoding is being used to interpret the form:

in modules/tcl/form.tcl

in ns_getform:
    ns_log Notice "ns_getform using encoding $encoding for charset $charset"

Someone should probably remove that log message, it is really
only useful for people debugging i18n encoding problems.

The idea is that ns_getform needs to know what character set
a submitted form was encoded in ,so it knows what conversion
is needed when parsing the form query vars into Tcl vars.