[open-ils-commits] r18278 - trunk/Open-ILS/src/c-apps (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Oct 12 11:19:57 EDT 2010
Author: miker
Date: 2010-10-12 11:19:54 -0400 (Tue, 12 Oct 2010)
New Revision: 18278
Modified:
trunk/Open-ILS/src/c-apps/oils_sql.c
Log:
skip unknown order_by entries instead of erroring
Modified: trunk/Open-ILS/src/c-apps/oils_sql.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_sql.c 2010-10-12 13:40:14 UTC (rev 18277)
+++ trunk/Open-ILS/src/c-apps/oils_sql.c 2010-10-12 15:19:54 UTC (rev 18278)
@@ -4416,26 +4416,10 @@
ClassInfo* order_class_info = search_alias( class_itr->key );
if( ! order_class_info ) {
- osrfLogError( OSRF_LOG_MARK,
- "%s: Invalid class \"%s\" referenced in ORDER BY clause",
+ osrfLogWarn( OSRF_LOG_MARK,
+ "%s: Invalid class \"%s\" referenced in ORDER BY clause, skipping it",
modulename, class_itr->key );
- if( ctx )
- osrfAppSessionStatus(
- ctx->session,
- OSRF_STATUS_INTERNALSERVERERROR,
- "osrfMethodException",
- ctx->request,
- "Invalid class referenced in ORDER BY clause -- "
- "see error log for more details"
- );
- jsonIteratorFree( class_itr );
- buffer_free( order_buf );
- free( having_buf );
- buffer_free( group_buf );
- buffer_free( sql_buf );
- if( defaultselhash )
- jsonObjectFree( defaultselhash );
- return NULL;
+ continue;
}
osrfHash* field_list_def = order_class_info->fields;
@@ -4804,6 +4788,13 @@
return NULL;
}
+ const ClassInfo* order_class_info = search_alias( class_alias );
+ if( ! order_class_info ) {
+ osrfLogWarn( OSRF_LOG_MARK, "%s: ORDER BY clause references class \"%s\" "
+ "not in FROM clause, skipping it", modulename, class_alias );
+ continue;
+ }
+
const char* class_alias =
jsonObjectGetString( jsonObjectGetKeyConst( order_spec, "class" ));
const char* field =
@@ -4831,22 +4822,6 @@
return NULL;
}
- const ClassInfo* order_class_info = search_alias( class_alias );
- if( ! order_class_info ) {
- osrfLogError( OSRF_LOG_MARK, "%s: ORDER BY clause references class \"%s\" "
- "not in FROM clause", modulename, class_alias );
- if( ctx )
- osrfAppSessionStatus(
- ctx->session,
- OSRF_STATUS_INTERNALSERVERERROR,
- "osrfMethodException",
- ctx->request,
- "Invalid class referenced in ORDER BY clause -- see error log for more details"
- );
- free( order_buf );
- return NULL;
- }
-
osrfHash* field_def = osrfHashGet( order_class_info->fields, field );
if( !field_def ) {
osrfLogError( OSRF_LOG_MARK,
More information about the open-ils-commits
mailing list