Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v
diff -u -N -r1.106 -r1.107
--- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 17 May 2018 14:42:03 -0000 1.106
+++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 14 Jun 2018 12:30:58 -0000 1.107
@@ -889,14 +889,11 @@
ad_proc -private apm_package_installed_p_not_cached {
package_key
} {
- if {[catch {set installed_p [db_string apm_package_installed_p {
- select 1 from apm_package_versions
- where package_key = :package_key
- and installed_p = 't'
- } -default 0]}]} {
- set installed_p 0
- }
- return $installed_p
+ return [db_string apm_package_installed_p {
+ select exists (select 1 from apm_package_versions
+ where package_key = :package_key
+ and installed_p) from dual
+ }]
}
ad_proc -public apm_package_enabled_p {
@@ -943,8 +940,10 @@
@return The number of instances of the indicated package.
} {
- return [db_exec_plsql apm_num_instances {}]
-
+ return [db_string query {
+ select count(*) from apm_packages
+ where package_key = :package_key
+ }]
}
ad_proc -public apm_parameter_update {
@@ -1248,13 +1247,9 @@
@return The package url of the instance of the package.
} {
- return [util_memoize [list apm_package_url_from_id_mem $package_id]]
+ return [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
}
-ad_proc -private apm_package_url_from_id_mem {package_id} {
- return [db_string apm_package_url_from_id {} -default {}]
-}
-
#
# package_key -> package_url
#
@@ -1263,14 +1258,9 @@
@return The package url of the instance of the package.
only valid for singleton packages.
} {
- return [util_memoize [list apm_package_url_from_key_mem $package_key]]
+ return [apm_package_url_from_id [apm_package_id_from_key $package_key]]
}
-ad_proc -private apm_package_url_from_key_mem {package_key} {
- set package_id [apm_package_id_from_key $package_key]
- return [apm_package_url_from_id $package_id]
-}
-
#
# package_key -> version_id
#
@@ -1340,7 +1330,11 @@
@return 1 if the indicated package version is installed, 0 otherwise.
} {
- return [db_string apm_package_version_installed_p {}]
+ return [db_0or1row apm_package_version_installed_p {
+ select 1 from apm_package_versions
+ where package_key = :package_key
+ and version_name = :version_name
+ }]
}
ad_proc -public apm_package_version_enabled_p {version_id} {
@@ -1875,20 +1869,23 @@
@author Peter Marklund
} {
- set html_string ""
-
- return $html_string
+ return [subst {