Commit 2692cebc authored by Geoff Cant's avatar Geoff Cant Committed by Geoff Cant
Browse files

MYSQL doesn't allow table aliases in COUNT queries. Adjusting

view.json.php to fully quality table names.
parent 8342703f
......@@ -56,7 +56,7 @@ switch ($type) {
$where = 'WHERE v.submittedto = ?';
$values = array($id);
if (!$submitted) {
$where .= 'OR (
$where .= ' OR (
a.community = ?
AND ( v.startdate IS NULL OR v.startdate < ? )
AND ( v.stopdate IS NULL OR v.stopdate > ? )
......@@ -71,7 +71,7 @@ switch ($type) {
}
$count = count_records_sql('
SELECT COUNT(v.id)
SELECT COUNT(id)
FROM ' . $prefix . 'view v
LEFT OUTER JOIN ' . $prefix . 'view_access_community a ON a.view=v.id
' . $where,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment