Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl,v diff -u -N -r1.31 -r1.32 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 15 Nov 2008 12:07:03 -0000 1.31 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 15 Nov 2008 22:00:40 -0000 1.32 @@ -1463,11 +1463,13 @@ set current_url [ns_conn url] if { [parameter::get -parameter CacheProductAsFile -default 0] && [string match "*[ec_url]product*" $current_url ] } { regexp {product_id=([1-9][0-9]*)} $current_url scratch product_id - db_0or1row get_sku_from_product_id "select sku from ec_products where product_id = :product_id" - if { [info exists sku] && [file exists "[file join [acs_root_dir] www [string trim [ec_url] /] ${sku}.html]"] } { - # this is a valid product url, redirect to the existing static version - ad_returnredirect "[ec_url]${sku}.html" - ad_script_abort + if { [info exists product_id] } { + db_0or1row get_sku_from_product_id "select sku from ec_products where product_id = :product_id" + if { [info exists sku] && [file exists "[file join [acs_root_dir] www [string trim [ec_url] /] ${sku}.html]"] } { + # this is a valid product url, redirect to the existing static version + ad_returnredirect "[ec_url]${sku}.html" + ad_script_abort + } } }