Index: query.py
===================================================================
--- query.py	(revision 7311)
+++ query.py	(working copy)
@@ -690,7 +690,25 @@
                 'groups': groupsequence or [(None, tickets)],
                 'last_group_is_partial': last_group_is_partial,
                 'paginator': results}
-    
+                
+    def get_parameters(self):
+       # this is a workaround for a bug that arises because the request argument is called "row" 
+       #but the query language syntax expects "rows"
+       
+       if self.constraints.has_key('row'):
+           	self.rows = self.constraints['row']
+           	del self.constraints['row']
+       
+       return {'constraints':self.constraints,
+                'col': self.cols,
+                'order':self.order,
+                'desc':self.desc,
+                'group': self.group,
+                'groupdesc':self.groupdesc,
+                'row': self.rows,
+                'page':self.page,
+                'max':self.max}
+       
@@ -759,16 +777,28 @@
                 user = email or name or None 
                       
             if user: 
-                qstring = qstring.replace('$USER', user) 
-            self.log.debug('QueryModule: Using default query: %s', str(qstring)) 
-            constraints = Query.from_string(self.env, qstring).constraints 
-            # Ensure no field constraints that depend on $USER are used 
+                qstring = qstring.replace('$USER', user)
+            
+            self.log.debug('QueryModule: Using default query: %s', str(qstring))
+            default_query = Query.from_string(self.env, qstring)
+            
+            constraints = default_query.constraints
+                      
+            # rather than screw around with additional tests all down the line, we'll
+            # just put fake "arguments" into the request object
+            for field, value in default_query.get_parameters().items():
+            	if not req.args.has_key(field):
+            		req.args[field] = value
+            
+          	# Ensure no field constraints that depend on $USER are used 
             # if we have no username. 
+
             for field, vals in constraints.items(): 
                 for val in vals: 
                     if val.endswith('$USER'): 
-                        del constraints[field] 
-
+                        del constraints[field]
+           	
+                        

