Forum OpenACS Q&A: Function 'hp_get_nh_member_count(int4)' does not exist

Where is this function defined? When I try to go to
/homepages/neighborhood.tcl in normal view, I get the above error.
Tree view works fine, though.

Shalon Wood

Are you using the latest CVS tree or 3.2.4?  There have been bug fixes  in homepages that are in the tree (and our upcoming 3.2.5 release).
I'm using the CVS tree as of yesterday (because I'm using Postgresql 7.1).
It looks like I missed that one when I ported it - Sorry! Here's a patch (both the datamodel file and the neighborhoods.tcl file need to be patched). I'll log it in the SDM and send Roberto a note as well.
diff -urBb acs3-pg/www/doc/sql/homepage.sql openkurup/www/doc/sql/homepage.sql
--- acs3-pg/www/doc/sql/homepage.sql	Fri Apr 14 14:52:01 2000
+++ openkurup/www/doc/sql/homepage.sql	Thu Apr 26 15:50:27 2001
@@ -764,6 +764,18 @@
 ' language 'plpgsql';
 
 
+create function hp_get_nh_member_count(integer) returns integer as '
+declare
+	neighborhoodid alias for $1;
+	counter		   integer;
+BEGIN
+	select into counter count(*) from users_homepages
+	    where neighborhood_id = neighborhoodid;
+	return counter;
+END;
+' language 'plpgsql';
+
+
 create function hp_neighborhood_in_subtree_p(integer,integer) returns varchar as '
 declare
 	source_node alias for $1;
diff -urBb acs3-pg/www/homepage/neighborhoods.tcl openkurup/www/homepage/neighborhoods.tcl
--- acs3-pg/www/homepage/neighborhoods.tcl	Mon Mar 26 14:22:00 2001
+++ openkurup/www/homepage/neighborhoods.tcl	Thu Apr 26 15:50:40 2001
@@ -200,7 +200,8 @@
                hp_neighborhood_level_gen(neighborhood_id,1,0) as level, 
                description,
                parent_id,
-	hp_neighborhood_sortkey_gen(neighborhood_id,hp_get_neighborhood_root_node()) as generated_sort_key
+	hp_neighborhood_sortkey_gen(neighborhood_id,hp_get_neighborhood_root_node()) as generated_sort_key,
+    hp_get_nh_member_count(neighborhood_id) as total_homepages
 	from users_neighborhoods
 	where hp_neighborhood_level_gen(neighborhood_id,1,0) > 1
         and  hp_neighborid_is_subnode(neighborhood_id,$neighborhood_node) = 't'
The provided patch works except when the admin viewing the page has no
web page of their own in the system.  At that point
member_neighborhood_id is undefined but accessed.

An improved patch (I hope!) is uploaded to the SDM as patch#10 against
the OpenACS package.