Index: openacs-4/packages/static-pages/www/admin/commentability-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/www/admin/commentability-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/static-pages/www/admin/commentability-postgresql.xql	27 Jul 2001 15:43:31 -0000	1.1
+++ openacs-4/packages/static-pages/www/admin/commentability-postgresql.xql	2 Aug 2001 19:27:51 -0000	1.2
@@ -6,37 +6,39 @@
 
 	select spf.folder_id,
 case when spf.folder_id = :root_folder_id then '[acs_root_dir]/www/' else 
-	content_item__get_title(spf.folder.id)||'/' end as folder_name,
+	content_item__get_title(spf.folder_id)||'/' end as folder_name,
 		static_page__five_n_spaces(lev) as spaces,
 		static_page_id,
                 substr(filename,instr(filename,'/',-1)+1) as filename,
-case when p_file.grantee_id = NULL then 'not commentable' else 'commentable' end as file_permission,
+case when p_file.grantee_id is NULL then 'not commentable' else 'commentable' end as file_permission,
 
 case when show_comments_p = 't' then 'comments displayed' else 'comments summarized' end as display_policy,
 
-case when p_folder.grantee_id = NULL then 'children not commentable' else 'children commentable' end as folder_permission
+case when p_folder.grantee_id is NULL then 'children not commentable' else 'children commentable' end as folder_permission
 
-from ((static_pages sp RIGHT OUTER JOIN
-   (select tree_level(folder_id) as lev from 
+FROM ((static_pages sp RIGHT OUTER JOIN
+  (select folder_id, tree_level(folder_id) as lev from 
  	(select folder_id from sp_folders 
-		where tree_sortkey like ( select tree_sortkey || '%'
+		where tree_sortkey like ( select tree_sortkey ||'%'
 		from sp_folders
-		where folder_id = :root_folder_id)
-	)
-   )
+		where folder_id = :root_folder_id )
+	) as foo
+  ) as spf
+ ON spf.folder_id = sp.folder_id)
+  
  LEFT OUTER JOIN
 acs_permissions p_file ON 
- 	(p_file.grantee_id = acs.magic_object_id('the_public') and
+	(p_file.grantee_id = acs__magic_object_id('the_public') and 
 	 p_file.privilege = 'general_comments_create' and
-	 p_file.object_id = sp.static_page_id)
+	 p_file.object_id = sp.static_page_id))
 
  LEFT OUTER JOIN
 acs_permissions p_folder ON
-	(p_folder.grantee_id = acs.magic_object_id('the_public') and 
+	(p_folder.grantee_id = acs__magic_object_id('the_public') and 
 	 p_folder.privilege = 'general_comments_create' and
-         p_folder.object_id = spf.folder_id)
+      p_folder.object_id = spf.folder_id)
 
-      </querytext>
+</querytext>
 </fullquery>