Okay, since nobody replied, I went digging through the code.
It seems the ad_proc code that deals with namespaces is broken. The code does this:
# (SDW - OpenACS). If proc_name is being defined inside a namespace, we
# want to use the fully qualified name. Except for actually defining the
# proc where we want to use the name as passed to us. We always set
# proc_name_as_passed and conditionally make proc_name fully qualified
# if we were called from inside a namespace eval.
set proc_name_as_passed $proc_name
set proc_namespace [uplevel {::namespace current}]
if { $proc_namespace != "::" } {
regsub {^::} $proc_namespace {} proc_namespace
set proc_name "${proc_namespace}::${proc_name}"
}
The problem with this is that it relies on a call to uplevel {::namespace current}, which doesn't return correctly when the procedure is not physically within a namespace block.
The problem only happens for procedures declared like this:
namespace eval foo {}
ad_proc -public ::foo::bar {}
In these cases the uplevel call returns "::" as the namespace (instead of ::foo), which screws up ad_proc, and consequently the QD, which relies on the ad_proc caching.
I'm looking into how to fix it.
-Roberto