Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Georgii’s picture

Moreover, it is added to the HTML HEAD section even if no chart is placed there. I.e. it is added to EVERY page (even to 404 error page) which looks like incorrect.
Are there any comments on this or plans to fix?

Georgii’s picture

As for aggregation, the reason should be here

function views_charts_init() {
  $mpath = drupal_get_path('module', 'views_charts');
  drupal_add_js($mpath .'/views_charts.js', 'module', 'header', FALSE, TRUE, FALSE);
  drupal_add_css($mpath .'/views_charts.css');
}

The last FALSE in drupal_add_js turns aggregation off, bun unclear why. Was it done on purpose?

And the question about having views_chart.js on every page is still actual.

Leon Kessler’s picture

Can we get this fixed please? With something like this patch.
We're only using this module for a handful of admin pages, and now we have the js added un-aggregated onto every page request.

There was obviously a reason why the developer choose not to include this on js preprocessing. Although the fact that it's included on every page makes me think it was just for debugging purposes only.

Thanks
Leon

Leon Kessler’s picture

Leon Kessler’s picture

Urgh, d/o not accepting the patch uploaded. Try once more...