I ran into this issue now on several of my drupal installations (pressflow, drupal). I don't know why and how to fix this problem but I see that piwik adds the javscript code twice in the footer. This is not really useful as it counts every user twice and slows down the page loading. Is there someone else who had problems like this?

I try to find it out, but i have no Idea where to start.

CommentFileSizeAuthor
#9 advagg-1051172-8.patch3.68 KBmikeytown2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Category: bug » support
Status: Active » Closed (cannot reproduce)

Not by this module. It will be added once.

Try out: Disable one by one module until you found the buggy module... if it's not pressflow I guess you will find it. I would personally start with broken cufon... and do not forget to report back, please. :-)

broncomania’s picture

I think I found the problem.It looks like an advagg bug. If I enable the use Advagg in closure checkbox it gets rendered twice. The original and the compressed one are delivered.

Needs some time to found out but I think I got it!

broncomania’s picture

Status: Closed (cannot reproduce) » Needs review
hass’s picture

Status: Needs review » Closed (cannot reproduce)
broncomania’s picture

Hmm, so I tested it again including cache clearing because I use boost and the problem only exist if I use the advagg_closure function. i disable it, but I am not sure if this is the best solution.I am wodering that I am the only one who get this effect. Any idea where to start to debugg?

hass’s picture

Project: Piwik Web Analytics » Advanced CSS/JS Aggregation
Version: 6.x-2.0 » 6.x-1.x-dev
Category: support » bug
Status: Closed (cannot reproduce) » Active

So advagg has a bug. Moving queue.

mikeytown2’s picture

Issue has to do with drupal_add_js being in hook_footer.
http://drupal.org/project/bundlecache
http://drupal.org/project/javascript_aggregator
Will have this same issue, as all these module use the same technique to modify the footer JS to include the custom JS file instead of the normal drupal core one. Will look for ways around this in advagg; placing the piwik logic in a template_preprocess_page hook would probably fix the issue without any side effects.

mikeytown2’s picture

Tested with this:

function test_footer() {
  $script = '// TEST ' . rand();
  drupal_add_js($script, 'inline', 'footer');
}

Shows up in the footer twice, rand is the same so hook only gets ran once. Bug is with advagg; digging deep

mikeytown2’s picture

Status: Active » Fixed
FileSize
3.68 KB

Committed this patch. Thanks for the bug report.

broncomania’s picture

Thx mikeytown2!! I thought I was the only one with that problem.

Status: Fixed » Closed (fixed)

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

rhylos’s picture

Did #9 get commited as Google Analytics (very similar to piwik in function) does the same thing. Entered twice if the addv agg has the closure enabled.