Index: openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql,v diff -u -r1.15 -r1.15.2.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql 21 Oct 2018 17:36:23 -0000 1.15 +++ openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql 16 Jul 2020 16:27:17 -0000 1.15.2.1 @@ -16,14 +16,14 @@ acs_permission__permission_p(object_id, :user_id, 'admin') as object_admin_p from apm_packages p join apm_package_types using (package_key) right outer join (WITH RECURSIVE site_node_path AS ( - select node_id, parent_id - from site_nodes where node_id = :root_id - UNION ALL - select c.node_id, c.parent_id - from site_node_path p, site_nodes as c where c.node_id = p.parent_id - ) - select sm0.*, (char_length(url)-char_length(replace(url, '/', ''))-1) as mylevel - from (select distinct n.node_id, + select node_id, parent_id + from site_nodes where node_id = :root_id + UNION ALL + select c.node_id, c.parent_id + from site_node_path p, site_nodes as c where c.node_id = p.parent_id + ) + select sm0.*, (char_length(url)-char_length(replace(url, '/', ''))-1) as mylevel + from (select distinct n.node_id, site_node__url(n.node_id) as url, site_node__url(n.parent_id) as parent_url, n.name, @@ -36,7 +36,7 @@ where (n.object_id is null or acs_permission__permission_p(n.object_id, :user_id, 'read')) and (n.node_id = path.node_id or n.parent_id in ([join $expand ", "]))) sm0) as site_map on site_map.object_id = p.package_id - $where_limit + $where_limit order by url @@ -45,19 +45,25 @@ postgresql8.4 - WITH apm_services AS ( - select package_id, - ap.package_key, - ap.instance_name, - apm_package_type__num_parameters(ap.package_key) as parameter_count - from apm_packages ap, - apm_package_types - where ap.package_key = apm_package_types.package_key - and package_type = 'apm_service' - and not exists (select 1 from site_nodes sn where sn.object_id = package_id) + select + ap.package_id, + ap.package_key, + ap.instance_name, + apm_package_type__num_parameters(ap.package_key) as parameter_count + from apm_packages ap + where ap.package_id IN ( + select orig_object_id from + acs_permission.permission_p_recursive_array(array( + select package_id + from apm_packages ap, + apm_package_types + where ap.package_key = apm_package_types.package_key + and package_type = 'apm_service' + and not exists (select 1 from site_nodes sn where sn.object_id = package_id) + order by instance_name + ), :user_id, 'admin') + ) order by instance_name - ) select * from apm_services where - acs_permission__permission_p(package_id, :user_id, 'admin')