Index: openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql,v
diff -u -r1.11.4.1 -r1.11.4.2
--- openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql	12 Jun 2016 17:34:52 -0000	1.11.4.1
+++ openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql	3 Aug 2016 10:08:23 -0000	1.11.4.2
@@ -331,13 +331,9 @@
    p_party_id integer
 ) RETURNS boolean AS $$
 DECLARE
-        v_member_p			  char(1);
+        v_member_p			  boolean;
 BEGIN
-       select CASE 
-		   WHEN count(*) = 0
-		   THEN 'f'
-		   ELSE 't'
-	      END
+       select (count(*) = 0)
         into v_member_p
         from dual
         where exists (select 1
@@ -348,7 +344,6 @@
         return v_member_p;
 
 END;
-
 $$ LANGUAGE plpgsql;
 
 
@@ -364,21 +359,20 @@
    p_party_id integer
 ) RETURNS boolean AS $$
 DECLARE
-        r_rv				  char(1);
+        r_rv				  boolean;
 BEGIN
 	-- THIS NEEDS TO BE CHECKED!
 	-- chak, 2002-07-01
 	select CASE
-		WHEN acs_permission__permission_p(p_community_id, p_party_id, 'dotlrn_admin_community') = 'f'
+		WHEN acs_permission__permission_p(p_community_id, p_party_id, 'dotlrn_admin_community') is false
 		THEN acs_permission__permission_p(p_community_id,p_party_id,'admin')
-		ELSE 't'	
+		ELSE true
 	     END
 	   into r_rv
            from dual;
 
 	return r_rv;
 END;
-
 $$ LANGUAGE plpgsql;
 
 
@@ -421,22 +415,17 @@
 --
 CREATE OR REPLACE FUNCTION dotlrn_community__has_subcomm_p(
    p_community_id integer
-) RETURNS varchar AS $$
+) RETURNS boolean AS $$
 DECLARE
-	r_rv char(1);
+	r_rv boolean;
 BEGIN
-	select CASE
-		WHEN count(*) = 0
-		THEN 'f'
-		ELSE 't'
-	       END
+	select (count(*) = 0)
 	  into r_rv
-	  from dual 
+	  from dotlrn_communities_all 
          where dotlrn_communities_all.community_id = p_community_id;
 	 
 	 return r_rv;
 END;
-
 $$ LANGUAGE plpgsql;
 
 create view dotlrn_communities_full
