From 96c404dd1ebaae5974669394c6a5e369f1d1ecb3 Mon Sep 17 00:00:00 2001
From: Mike Rylander <mrylander@gmail.com>
Date: Wed, 21 Mar 2012 12:14:44 -0400
Subject: [PATCH] Shooting 2 obvious thinkos d-e-d dead. Pardon the rogueness.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
---
 Open-ILS/src/c-apps/oils_sql.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c
index 887a2df89e..24795b0ed0 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -2981,7 +2981,7 @@ static char* searchPredicate( const ClassInfo* class_info, osrfHash* field,
 		buffer_fadd(
 			_p,
 			"\"%s\".%s IS NULL",
-			class_info->class_name,
+			class_info->alias,
 			osrfHashGet( field, "name" )
 		);
 		pred = buffer_release( _p );
@@ -5101,7 +5101,7 @@ static char* buildOrderByFromArray( osrfMethodContext* ctx, const jsonObject* or
 		const char* direction =
 			jsonObjectGetString( jsonObjectGetKeyConst( order_spec, "direction" ) );
 		if( direction ) {
-			if( direction[ 0 ] || 'D' == direction[ 0 ] )
+			if( direction[ 0 ] && ( 'd' == direction[ 0 ] || 'D' == direction[ 0 ] ) )
 				OSRF_BUFFER_ADD( order_buf, " DESC" );
 			else
 				OSRF_BUFFER_ADD( order_buf, " ASC" );
-- 
2.11.0