Project

General

Profile

Bug #215

Incorrect stats if item table differs from item name

Added by Vasily Bezruchkin almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
Start date:
August 22, 2012
Due date:
% Done:

100%

Estimated time:

Description

There is a functionality to print item statistics on admin panel index page. You only need to create hook as follows:

        <hook name="phpAdminIndexBeforeStatsGet" type="php">
            <![CDATA[
$items['articles'] = array(
    'statuses' => array('approval', 'active', 'rejected', 'suspended'),
    'config' => true,
    'url' => 'manage/articles/',
    'nochart' => true
);

$items['articlecats'] = array(
    'statuses' => array('inactive', 'active'),
    'config' => true,
    'url' => 'manage/articlecats/',
    'nochart' => true,
    'cause' => 'AND `id_parent` > 0'
);
            ]]>
        </hook>

admin/index.php has processing:

$iaDb->setTable($item);
$stats = $iaDb->keyvalue("`status`, count(id)", "1=1 {$cause} GROUP BY `status`");
$iaDb->resetTable();
$chart = array('all' => 0, 'status' => array(), 'url' => $about['url'].'?status=');

So this code will not work if item table differs from its name.

History

#1

Updated by Vasily Bezruchkin almost 8 years ago

  • Description updated (diff)
#2

Updated by Vasily Bezruchkin almost 8 years ago

  • Assignee set to Batyr Mackenov
  • Target version changed from 2.2.3 to 2.2.2
#3

Updated by Vasily Bezruchkin almost 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Fixed. Rev 2643

Also available in: Atom PDF