| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Trac
Revision: 7505
Author: rblank
Date: 01 Sep 2008 18:10:27
Diff at Trac: http://trac.edgewall.org/changeset/7505
Changes:0.11-stable: Fixed a pagination problem in custom queries when no constraints are selected.
Closes #7544.
Files:| ... | ...@@ -508,15 +508,13 @@ | |
| 508 | 508 | args.append(constraint_sql[1]) |
| 509 | 509 | |
| 510 | 510 | clauses = filter(None, clauses) |
| 511 | if clauses or cached_ids: | |
| 512 | sql.append("\nWHERE ") | |
| 513 | 511 | if clauses: |
| 512 | sql.append("\nWHERE ") | |
| 514 | 513 | sql.append(" AND ".join(clauses)) |
| 515 | if cached_ids: | |
| 516 | if clauses: | |
| 514 | if cached_ids: | |
| 517 | 515 | sql.append(" OR ") |
| 518 | sql.append("id in (%s)" % (','.join( | |
| 519 | [str(id) for id in cached_ids]))) | |
| 516 | sql.append("id in (%s)" % (','.join( | |
| 517 | [str(id) for id in cached_ids]))) | |
| 520 | 518 | |
| 521 | 519 | sql.append("\nORDER BY ") |
| 522 | 520 | order_cols = [(self.order, self.desc)] |