Conflicts with Javascript Aggregator

NathanRAFT - April 21, 2008 - 18:46
Project:Hovertips and Clicktips
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

The following causes problems with Javascript Aggregator. The aggregator is looking for the "?q=hovertip/settings_js'" and can not process it. Further more excluding it from the aggregator doesn't work as it is not a true js file.

/**
* Load the necessary javascript and stylesheet files.
* This was once an implimentation of hook_init, however one cannot
* reliably call drupal_add_css or drupal_add_js from that function.  So
* instead we call this function from hook_menu.
*/
function _hovertip_init() {
  drupal_add_css(drupal_get_path('module', 'hovertip').'/hovertip.css');
  drupal_add_js(drupal_get_path('module', 'hovertip') . '/hovertip.js');
  drupal_add_js('?q=hovertip/settings_js');
}

Changing the last line here fixes the problem.

/**
* Load the necessary javascript and stylesheet files.
* This was once an implimentation of hook_init, however one cannot
* reliably call drupal_add_css or drupal_add_js from that function.  So
* instead we call this function from hook_menu.
*/
function _hovertip_init() {
  drupal_add_css(drupal_get_path('module', 'hovertip').'/hovertip.css');
  drupal_add_js(drupal_get_path('module', 'hovertip') . '/hovertip.js');
  drupal_add_js(_hovertip_get_javascript(), 'inline');
}

#1

Dave Cohen - May 9, 2008 - 21:58
Category:bug report» support request
Status:active» patch (code needs review)

There was a reason why I changed that line from doing an 'inline' to a regular add. I just can't recall what it was, and didn't log it properly when I checked it in.

I've been trying to test with Javascript Aggregator, but I can't get it to work. It litters my pages with messages like
warning: filemtime() [function.filemtime]: stat failed for yogadex/htdocs/misc/jquery.js in /home/dave/work/yogadex/profiles/custom/modules/javascript_aggregator/javascript_aggregator.module on line 49.

(It's looking for all files in the wrong place).

Anyway, here's the patch I'm thinking of checking in.

AttachmentSize
hovertip-aggregator.diff1.26 KB

#2

Dave Cohen - May 9, 2008 - 22:05
Status:patch (code needs review)» fixed

Checked it in.

#3

Anonymous (not verified) - May 23, 2008 - 22:11
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.