When generating reports, sometimes I get a tabular report and sometimes I get a google chart. Most of the time I get a tabular report. Can advise what triggers the chart view?

CommentFileSizeAuthor
#6 ad_report.module-797274.patch549 bytestacituseu

Comments

styrbaek’s picture

I newer get the chart??

adam_c’s picture

I would also like to access graphical charts but cannot seem to find where they are enabled or generated.

foxtrotcharlie’s picture

I think that you only get the chart graphic when you view a report for a single ad. So not if you are viewing the top level report page (/admin/content/ad/report). To view the graphic for a single ad, click on the ad title from the top level report, and then click the 'reports' tab.

Molot’s picture

Subscrube

Shouldn't this be feature request to show graphs on all levels?

tacituseu’s picture

Category: support » bug
Status: Active » Needs review

It's a bug, ad_report_admin_display() ('admin/content/ad/report/display' handler) contains the following:

  $ads = array();
  $output .= ad_report_admin_ad_table(strtotime($start), strtotime($end), $group, FALSE, $ads);
  $output .= '<div>'. l(t('Modify report'), 'admin/content/ad/report') .'</div>';
  $start_time = strtotime($start);
  $end_time = strtotime($end);
  $elapse = $end_time - $start_time;
  if (count($ads) && $start && $end && $elapse > 0 && $start > 0 && $end > 0) {
  // code plotting the first five ads on the graph here
  }

it seems the intention was to fill $ads array passing it by reference to ad_report_admin_ad_table() but it is declared as:

function ad_report_admin_ad_table($start = 0, $end = 0, $group = array(), $csv = FALSE, $ads)

so the $ads stays empty and the code generating graph is never executed

tacituseu’s picture

StatusFileSize
new549 bytes

this should fix it

pontus_nilsson’s picture

I can confirm that the patch in Comment 6 makes the report appear.

john franklin’s picture

Status: Needs review » Fixed

Committed. Thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.