[open-ils-commits] r7856 - branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Oct 3 13:33:14 EDT 2007


Author: miker
Date: 2007-10-03 13:22:26 -0400 (Wed, 03 Oct 2007)
New Revision: 7856

Modified:
   branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Log:
backporting critical SQL fix for patron search

Modified: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm	2007-10-03 17:10:26 UTC (rev 7855)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm	2007-10-03 17:22:26 UTC (rev 7856)
@@ -508,7 +508,7 @@
 	my $clone_select = '';
 	$clone_select = "JOIN (SELECT cu.id as id FROM $a_table ca ".
 			   "JOIN $u_table cu ON (cu.mailing_address = ca.id OR cu.billing_address = ca.id) ".
-			   "WHERE $addr_where) AS clone USING (id)" if ($addr_where);
+			   "WHERE $addr_where) AS clone ON (clone.id = users.id)" if ($addr_where);
 
 	my $select = '';
 	if ($usr_where) {
@@ -533,7 +533,7 @@
 	}
 
 	if (!$ws_ou) {  # XXX This should be required!!
-		$ws_ou = actor::org_unit->search( { parent_ou => undef } )->[0]->id;
+		$ws_ou = actor::org_unit->search( { parent_ou => undef } )->next->id;
 	}
 
 	my $opt_in_join = '';
@@ -548,7 +548,7 @@
 	$select = <<"	SQL";
 		SELECT	DISTINCT $distinct_list
 		  FROM	$u_table AS users
-			JOIN ($select) AS search USING (id)
+			JOIN ($select) AS search ON (search.id = users.id)
 			JOIN $descendants d ON (d.id = users.home_ou)
 			$opt_in_join
 			$clone_select



More information about the open-ils-commits mailing list