Adding a filter using ad_proc seems to break the scope of variables. instvars are not available if a class has a filter defined using ad_proc. Using proc it works ok.
Sample Code This breaks CollabPage instvar:
CollabPage ad_proc fetch_latest_revision_if_no_live_revision {args} {
Documentation String
} {
set method [self calledproc]
my log "collabpage filter method='${method}'"
if {$method eq "fetch_object"} {
array set the_args $args
if {$the_args(-revision_id) eq "0"} {
set the_args(-revision_id) "[content::item::get_best_revision -\
item_id $the_args(-item_id)]"
}
eval [concat next [array get the_args]]
} else {
next
}
}
CollabPage filter fetch_latest_revision_if_no_live_revisionFor example CollabPage instvar storage_type does not find the storage_type instvar. (CollabPage is a subtype of ::xowiki::Page which is a subtype of ::Generic::CrClass)Using Collabpage proc .... instead works fine.
I think the filters here make sense since I want to capture the call to fetch_object without having to rewrite all the code. I also just want to get something working without redesigning xotcl-core. Maybe once I get it working, I an better evaluate changes to xotcl-core that might make it more flexible.
Request notifications