Not signed in (Sign In)
 
 
 
Oct 27th 2008 edited
 
Here is the query:
SELECT
c.CategoryID AS CategoryID,
c.Name AS Name,
c.Description AS Description,
coalesce(b.Blocked, 0) AS Blocked
FROM
LUM_Category c
left join LUM_CategoryRoleBlock crb ON c.CategoryID = crb.CategoryID and crb.RoleID = 4
left join LUM_CategoryBlock b ON c.CategoryID = b.CategoryID and b.UserID = 1
WHERE (
crb.Blocked = '0'
or crb.Blocked = 0
or crb.Blocked is null
)
GROUP BY c.CategoryID, c.Name, c.Description
ORDER BY b.Blocked asc, c.Priority asc;


b.blocked is missing from the GROUP BY clause. The error in triggered only when ONLY_FULL_GROUP_BY is in sql_mode (MySql setting) :SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY'
 
Oct 27th 2008
 
I think it only need these changes:Index: Vanilla.Class.CategoryManager.php
===================================================================
--- Vanilla.Class.CategoryManager.php (revision 767)
+++ Vanilla.Class.CategoryManager.php (working copy)
@@ -68,7 +68,7 @@
if ($this->Context->Session->UserID > 0) {
$s->AddJoin('CategoryRoleBlock', 'crb', 'CategoryID', 'c', 'CategoryID', 'left join', ' and crb.'.$this->Context->DatabaseColumns['CategoryRoleBlock']['RoleID'].' = '.$this->Context->Session->User->RoleID);
$s->AddJoin('CategoryBlock', 'b', 'CategoryID', 'c', 'CategoryID', 'left join', ' and b.'.$this->Context->DatabaseColumns['CategoryBlock']['UserID'].' = '.$this->Context->Session->UserID);
- $s->AddSelect('Blocked', 'b', 'Blocked', 'coalesce', '0');
+ $s->AddSelect('Blocked', 'b', 'Blocked', 'coalesce', '0', 1);
} else {
$s->AddJoin('CategoryRoleBlock', 'crb', 'CategoryID', 'c', 'CategoryID', 'left join', ' and crb.'.$this->Context->DatabaseColumns['CategoryRoleBlock']['RoleID'].' = 1');
}
@@ -82,7 +82,7 @@
} else {
// Identify which of these categories is blocked by role
// (so administrators can easily see what they do and don't have access to)
- $s->AddSelect('Blocked', 'crb', 'RoleBlocked', 'coalesce', '0');
+ $s->AddSelect('Blocked', 'crb', 'RoleBlocked', 'coalesce', '0', 1);
}

$this->DelegateParameters['IncludeCount'] = $IncludeCount;
 
Oct 27th 2008
 
Fixed people revision 770

Issue information

  • 95
  • Dinoboff

    Dinoboff

    Bug Tracker

  • Resolved
  • Low
  • Bug

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.