Forum OpenACS Development: Re: callbacks and plain parameters

Collapse
Posted by Lee Denison on
I've committed a fix on head which should solve this problem. It only shows up when a contract only has positional arguments. For a plain ad_proc with only positional arguments an arg parser is not created because the standard tcl proc command will happily parse positional arguments for us. For a callback however the implementation relies on the arg parser of the contract so we need to create it anyway.
Collapse
Posted by Jim Lynch on
Hi,

Here is a diff to 00-proc-procs.tcl of openacs-5.2.x which 
allows the callbacks to only have positional parameters:

===== CUT HERE =====
--- 00-proc-procs.tcl~  2005-07-21 05:11:16.000000000 -0700
+++ 00-proc-procs.tcl   2006-05-16 03:55:22.637411203 -0700
@@ -432,7 +432,7 @@
         # We are creating a callback implementation so we invoke the
         # arg parser of the contract proc
         uplevel [::list proc $proc_name_as_passed args "    ::callback::${callback}::contract__arg_parser\n${log_code}$code_block"]
-    } elseif { [llength $switches] == 0 } {
+    } elseif { $callback eq "" && [llength $switches] == 0 } {
         uplevel [::list proc $proc_name_as_passed $arg_list "${log_code}$code_block"]
     } else {
          set parser_code "    ::upvar args args\n"
===== CUT HERE =====
Collapse
Posted by Jim Lynch on
or, as discussed, to have ad_proc build an arg parser in the case of a callback with only positional parameters.