Commit 39e92e9c authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Fix KB tree count; fixes #5616

parent 1681a5cb
......@@ -253,9 +253,9 @@ JAVASCRIPT;
$items_subquery = new QuerySubQuery(
array_merge_recursive(
[
'COUNT' => 'cpt',
'FROM' => KnowbaseItem::getTable(),
'WHERE' => [
'SELECT' => ['COUNT DISTINCT' => KnowbaseItem::getTableField('id') . ' as cpt'],
'FROM' => KnowbaseItem::getTable(),
'WHERE' => [
KnowbaseItem::getTableField($cat_fk) => new QueryExpression(
DB::quoteName(KnowbaseItemCategory::getTableField('id'))
),
......@@ -304,9 +304,9 @@ JAVASCRIPT;
$root_items_count = $DB->request(
array_merge_recursive(
[
'COUNT' => 'cpt',
'FROM' => KnowbaseItem::getTable(),
'WHERE' => [
'SELECT' => ['COUNT DISTINCT' => KnowbaseItem::getTableField('id') . ' as cpt'],
'FROM' => KnowbaseItem::getTable(),
'WHERE' => [
KnowbaseItem::getTableField($cat_fk) => 0,
]
],
......
Markdown is supported
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