Forum OpenACS Q&A: problem with simple-survey

Collapse
Posted by Windell Dubois on
While I was trying out the admin section using simple survey, I got this error:

Request Error
invalid command name "ad_html_security_check"
    while executing
"ad_html_security_check $value"
    (procedure "ad_page_contract_filter_proc_html" line 3)
    invoked from within
"[ad_page_contract_filter_proc $filter] $formal_name actual_value"
    (procedure "ad_page_contract" line 395)
    invoked from within
"ad_page_contract {

  Displays confirmation page for new survey creation or, if we
  just arrived from it, actually creates new survey.

  @param  sur..."
    ("uplevel" body line 2)
    invoked from within
"uplevel {
          ad_page_contract {

  Displays confirmation page for new survey creation or, if we
  just arrived from it, actually creates new surve..."
    (procedure "code::tcl::/web/myservice/packages/simple-survey/www/admin/sur..." line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 2)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
    $handler
      } ad_script_abort val {
    # do nothing
      }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
    rp_serve_abstract_file "$root/$path"
    set tcl_url2file([ad_conn url]) [ad_conn file]
    set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."

I backtraced the error to
/packages/acs-tcl/tcl/tcl-documentation-procs.tcl
but Im not sure what to do right now.  Can anyone help me?

Thanks In Advance

Windell.

Collapse
Posted by Jade Rubick on
That procedure should definitely be there. Do you see any errors in your error.log?
Collapse
Posted by Windell Dubois on
yes, there is something on error.log  The thing thats worrying me is that Im also getting this error when Im trying to add a new product in my ecommerce instance.

Here's what I got from error.log:

[10/Dec/2003:17:33:53][25773.40966][-conn2-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1
[10/Dec/2003:17:33:53][25773.40966][-conn2-] Notice: RP (964.297 ms): error in rp_handler: serving POST /ecommerce/admin/products/add-2
        ad_url "/ecommerce/admin/products/add-2" maps to file "/web/telecen/packages/ecommerce/www/admin/products/add-2.tcl"
errmsg is invalid command name "ad_html_security_check"
[10/Dec/2003:17:33:53][25773.40966][-conn2-] Notice: Querying '
            select 1
            where 't' = acs_permission__permission_p('732', '298', 'admin');'
[10/Dec/2003:17:33:53][25773.40966][-conn2-] Notice: dbinit: sql(localhost::telecen): '
            select 1
            where 't' = acs_permission__permission_p('732', '298', 'admin')
        '
[10/Dec/2003:17:33:53][25773.40966][-conn2-] Error: POST http://205.161.189.120:8000/ecommerce/admin/products/add-2?
referred by "http://205.161.189.120:8000/ecommerce/admin/products/add"
invalid command name "ad_html_security_check"
    while executing
"ad_html_security_check $value"
    (procedure "ad_page_contract_filter_proc_html" line 3)
    invoked from within
"[ad_page_contract_filter_proc $filter] $formal_name actual_value"
    (procedure "ad_page_contract" line 395)
    invoked from within
"ad_page_contract {
  Add a product.

  @author Eve Andersson (mailto:eveander@arsdigita.com)
  @creation-date Summer 1999
  @cvs-id $Id: add-2.tcl,v 1.4 2002..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {
          # ecommerce/www/admin/products/add-2.tcl
ad_page_contract {
  Add a product.

  @author Eve Andersson (mailto:eveander@arsdigita.com)
  @cre..."
    (procedure "code::tcl::/web/telecen/packages/ecommerce/www/admin/product..." line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 2)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
        $handler
      } ad_script_abort val {
        # do nothing
      }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
        rp_serve_abstract_file "$root/$path"
        set tcl_url2file([ad_conn url]) [ad_conn file]
        set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."

Collapse
Posted by Windell Dubois on
Do you know where that procedure is sourced??  maybe there's something wrong in that file, which needs to be URGENTLY undone.
Collapse
Posted by Jeff Davis on
ad_html_security_check is in acs-tcl/tcl/text-html-procs.tcl
and should be defined in any openacs install.
Collapse
Posted by Windell Dubois on
I found the file, and the proc's definition, now, should ad_html_security_checkup have the -public switch??  If it should, maybe thats the problem...
Collapse
Posted by Jade Rubick on
I don't think that's the problem. I'd guess that none of the tcl procs are initialized correctly.

You can test this out by making a simple test page and using the commands from there.

Or you can put an ns_log notice "XXX initializing" at the top of the file, restarting aolserver, and seeing if you notice that in your error log. I bet it won't show up.

It might be something earlier that's preventing it from starting up. It's hard to tell.

Collapse
Posted by Windell Dubois on
Jade:
I put the ns_log notice as you adviced me earlier, I got this on error.log:

[10/Dec/2003:20:22:13][32514.8192][-main-] Notice: XXX initializing
[10/Dec/2003:20:22:13][32514.8192][-main-] Error: Error sourcing /web/telecen/packages/acs-tcl/tcl/text-html-procs.tcl:
missing close-brace: possible unbalanced brace in comment
    while executing
"ad_proc ad_html_security_check { html } {

    Returns a human-readable explanation if the user has used any HTML
    tag other than the ones marked ..."
    (file "/web/telecen/packages/acs-tcl/tcl/text-html-procs.tcl" line 583)
    invoked from within
"source $__file "

Im going to check the source for that "unbalanced brace", but somehow I dont think I'll find any...

Collapse
Posted by Jade Rubick on
Did you have any luck? It could be another file that you're working on. If you have a package that has any files in the /tcl directory, check there too.
Collapse
Posted by Windell Dubois on
Thanks Jeff and Jade for all the help, I finally solved the problem.  My boss was trying to get around the "allowed tags" parameter in ACS Kernel, so he modied ad_html_security_check to his likings, which caused the glitch.  But he had a copy of the original file (thank God for that!) so we switched the files and restarted AOLserver.  No errors after that!!

By the way Jade, now that Ive got your atention, you have pretty nice documentation on your web page, I just wish it was a bit more extensive and detailed, but I finally manage to do whats needed.  Still, its a great help for people starting with OACS like me.

Thanks again,

Windell.

Collapse
Posted by Andrew Piskorski on
This is a good reason to always use CVS (or any version control system at all).
Collapse
Posted by Andrew Piskorski on
Or maybe you were using CVS, but the buggy change to ad_html_security_check had already been committed, so that file didn't show up when doing a "cvs -nq up". In that case, cvs2cl is handy for generating a date-ordered log of every commit that's been done - very useful for this sort of "what the heck files has someone committed lately and maybe broken?" sort of question.