Download & Extend

Calling drupal_add_js() in hook_init() causes intermittent error

Project:Clean Pagination
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Calling drupal_add_js() in hook_init() results in intermittent errors as the function is undefined until later in the bootstrap.

Fatal error: Call to undefined function drupal_add_js() in /sites/all/modules/cleanpager/cleanpager.module on line 53

Comments

#1

Status:active» needs review

The attached patch moves drupal_add_js() to the hook_menu() call.

It also addresses coding style issues reported by code-style.pl

AttachmentSize
cleanpager-280217-01.patch 3.42 KB

#2

Status:needs review» fixed

Wow, Josh, only took me a year to get to this. Eesh. Anyway, committed and done, just in time for a Drupal 7 release!

#3

Status:fixed» closed (fixed)

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