Title says all.

This is causing javascript errors when asynchronous module is not enabled.

Comments

andrewmacpherson’s picture

Status: Active » Needs review
StatusFileSize
new1.34 KB

Hi, I managed to get this working quite easily. We just need to test for the asynchronous module before adding the javascript file.

Add the following to template.php

if (module_exists('asynchronous')) {
  drupal_add_js(drupal_get_path('theme', 'chrysalis') .'/asynchronous.js');
}

Remove this line from chrysalis.info

scripts[] = asynchronous.js
andrewmacpherson’s picture

Assigned: Unassigned » andrewmacpherson
peterx’s picture

The javascript error I get in Firebug at http://d-theme.com/chrysalis is:
Drupal.settings.asynchronous is undefined.
asynchronous.js could have a test for Drupal.settings.asynchronous wrapped around the two statements that try to set Drupal.settings.asynchronous.

andrewmacpherson’s picture

Assigned: andrewmacpherson » Unassigned
dsanchez’s picture

I tried what is suggested in #1 but still get as pointed by #3

Message: 'Drupal.settings.asynchronous' is null or not an object
Line: 6
Char: 1
Code: 0
URI: http://xxxxxxxxxxxx/themes/chrysalis/asynchronous.js?c