Forum OpenACS Development: Newbie problem 2 Add a new note error

Collapse
Posted by Daniel D on
Hello All, I do have installed the latest version of AOLServer and OpenACS.
While following instructions for createing new package (Sample notes) I do
have following error when I am trying to add a new note:

(http://my.test.server.com/note/note-edit)

Request Error

invalid command name "samplenote::new"
    while executing
"samplenote::new db_1row do_insert { *SQL* }
"
    ("uplevel" body line 2)
    invoked from within
"uplevel #5 {
samplenote::new db_1row do_insert { *SQL* }
}"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 $args"
    (procedure "ad_page_contract_eval" line 2)
    invoked from within
"ad_page_contract_eval uplevel #$level $new_data"
    (procedure "ad_form" line 594)
    invoked from within
"ad_form -name note -form {
    note_id:key
    {title:text
        {label "Title"}
    }
    {body:text(textarea)
        {label "Body"}
    }
} -sele..."
    ("uplevel" body line 15)
    invoked from within
"uplevel {
          ad_page_contract {
        Simple add/edit form for samplenote.
} {
    note_id:integer,optional
}

set user_id [ad_maybe_redirect_fo..."
    (procedure "code::tcl::/web/service0/packages/samplenote/www/note-edit" 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 Jade Rubick on
I believe that part of the documentation is incorrect. Try this instead of:

samplenote::new db_1row do_insert { *SQL* }

do this:

db_exec_plsql do_insert { *SQL* }

You also might want to check and see if this is in the bugtracker. This should be filed as a bug if it isn't already. I believe Joel knows about this and plans to fix it.

Collapse
Posted by Daniel D on
Hello Jade,

Thank you very much. Your fix is the right solution, now it works!

Than you for your time.

DanielD