roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ganes...@apache.org
Subject svn commit: r780932 - /roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
Date Tue, 02 Jun 2009 04:32:10 GMT
Author: ganeshmb
Date: Tue Jun  2 04:32:09 2009
New Revision: 780932

URL: http://svn.apache.org/viewvc?rev=780932&view=rev
Log:
Bugs in search media functionality fixed.

Modified:
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java?rev=780932&r1=780931&r2=780932&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
(original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
Tue Jun  2 04:32:09 2009
@@ -377,14 +377,16 @@
         	}
         }
         
-        switch(filter.getOrder()) {
+        if (filter.getOrder() != null) {
+            switch(filter.getOrder()) {
             case NAME: orderBy.append(" order by m.name");break;
             case DATE_UPLOADED: orderBy.append(" order by m.dateUploaded");break;
             case TYPE: orderBy.append(" order by m.contentType");break;
             default:
+            }
         }
 
-        Query query = persistenceStrategy.getDynamicQuery(queryString.toString() + whereClause.toString());
+        Query query = persistenceStrategy.getDynamicQuery(queryString.toString() + whereClause.toString()
+ orderBy.toString());
         for (int i=0; i<params.size(); i++) {
             query.setParameter(i+1, params.get(i));
         }



Mime
View raw message