When you have the external download tracking on, using downloadtracker.js, and you also have prototype on your site you get a javascript error on every page. Prototype overwrites jquery's $ function. As a result of this $(document).ready(gaTrackerAttach) causes an error because $(document).ready is not a function. Simply replacing the $(document).ready(gaTrackerAttach) with jQuery(document).ready(gaTrackerAttach); will fix this.

Comments

budda’s picture

Status: Active » Fixed

Thansk. Fixed in CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

hass’s picture

Version: 7.x-1.x-dev » 5.x-1.x-dev
Priority: Normal » Critical
Status: Closed (fixed) » Needs work

I'm on the fence about committing this and i'm on the way to roll back the D5 patch. Drupal core uses $ for jquery replacement everywhere and .ready is widely used, too. Here are *only* two examples.

textarea.js

if (Drupal.jsEnabled) {
  $(document).ready(Drupal.textareaAttach);
}

autocomplete.js

// Global Killswitch
if (Drupal.jsEnabled) {
  $(document).ready(Drupal.autocompleteAutoAttach);
}

@budda - whatever prototype does here - i don't know, but prototype need to be fixed *not* google_analytics.

hass’s picture

This code change is not yet in sync with D6...

budda’s picture

I'm guessing here, but maybe the error doesn't show up with the Drupal Core js such as textareas because bkennedy isn't looking at pages with textareas on (comments or node edit forms).

What Prototype powered code is on the site to cause the errors bkennedy?

Using JQ() or JQuery() is still perfectly legal to use in any code as it's documented.

hass’s picture

Status: Needs work » Fixed

Whatever name space we will use it might give conflicts... next time it will be the library xyz and so on and so on...

I don't know what prototype does here, but it sounds buggy and will cause many incompatibilities anywhere in drupal. I'm rolling back this change for now to be in sync with GA6 and D6 core. If someone find out the real cause and this is not a prototype bug and core is not affected at the same time, we could thing about a fix, but we should understand the real issue first.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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