projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3004d8
)
Fixed regression in db_pager.
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Wed, 6 May 2015 20:30:47 +0000
(22:30 +0200)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Wed, 6 May 2015 20:31:07 +0000
(22:31 +0200)
includes/db_pager.inc
patch
|
blob
|
history
diff --git
a/includes/db_pager.inc
b/includes/db_pager.inc
index c2ae04b6ecbd15b474981232b1fee77c8dfdfc39..522b04b6873eb1aa9da1ca2258fa8c053c6d8574 100644
(file)
--- a/
includes/db_pager.inc
+++ b/
includes/db_pager.inc
@@
-287,11
+287,8
@@
class db_pager {
}
if ($where) $where = " WHERE ($where)";
}
if ($where) $where = " WHERE ($where)";
- if ($count) {
- $group = $group == '' ? "*" : "DISTINCT $group";
-
- return "SELECT COUNT(*) FROM (SELECT $group FROM $from $where) tmp_count";
- }
+ if ($count)
+ return "SELECT COUNT(*) FROM ($this->sql) tmp_count";
$sql = "$select FROM $from $where";
if ($group) $sql.= " GROUP BY $group";
$sql = "$select FROM $from $where";
if ($group) $sql.= " GROUP BY $group";
@@
-303,8
+300,8
@@
class db_pager {
if(isset($col['ord_priority'])) {
$columns[$col['ord_priority']] = $col;
}
if(isset($col['ord_priority'])) {
$columns[$col['ord_priority']] = $col;
}
-
}
-
krsort($columns);
+ }
+ krsort($columns);
foreach ($columns as $col) {
if (isset($col['ord'])) {
foreach ($columns as $col) {
if (isset($col['ord'])) {
@@
-313,7
+310,7
@@
class db_pager {
}
}
}
}
}
}
-
+
if (count($ord)) {
$ord = array_map(function_exists('mysql_real_escape_string') ?
'mysql_real_escape_string': 'mysql_escape_string', $ord);
if (count($ord)) {
$ord = array_map(function_exists('mysql_real_escape_string') ?
'mysql_real_escape_string': 'mysql_escape_string', $ord);