I'm using YUI and on my 403 page I'm getting this error:

Fatal error: Call to undefined function: drupal_add_js() in /usr/www/users/rockvote/internal/sites/all/modules/yui/yui.module on line 33

I'm also using LoginToboggan, which shows a user login form when a 403 comes up, and anonymous users can't view content (they must login).

Any ideas?

Comments

ChrisKennedy’s picture

After looking at it real quick, I think the drupal_add_js in yui_init() should be moved to yui_menu().

zadmichr’s picture

Priority: Normal » Critical

Hi,

I've the same problem when i enable the cache, an error occurs :
Fatal error: Call to undefined function: drupal_add_js() in.....sites/all/modules/yui/yui.module on line 33

This error occurs only when i use MSIE browser, it works fine on FireFox !!

Someone has solution ?

Thanks

zadmichr’s picture

Hi,

I've the same problem when i enable the cache, an error occurs :
Fatal error: Call to undefined function: drupal_add_js() in.....sites/all/modules/yui/yui.module on line 33

This error occurs only when i use MSIE browser, it works fine on FireFox !!

Someone has solution ?

Thanks

Nijip’s picture

I'm getting the same problem. I love the yui menu... but i've had to disable because of the above problem...

bakyildiz’s picture

The drupal_add_js was in yui_menu. But we have several yui packeges. Therefore we exported the common codes to yui module. What is the reason to move the code into yui_menu ?

bakyildiz’s picture

Hi Everybody,
I have enable the cache but still works fine. To solve i need to reproduce the problem locally. Can anybody help me ?

bakyildiz’s picture

Version: 5.x-2.1 » 5.x-2.2
Assigned: Unassigned » bakyildiz
Status: Active » Postponed (maintainer needs more info)

Please try the new version 2.2 and if the same problem is still there please give detailde instructions to reproduce the problem.

jbowman’s picture

I"m able to reproduce this problem by

- Turning caching on to the normal mode
- going to my site as http://hostname

If I go to my site as http://hostname/index.php then it loads correctly

Stardog’s picture

I get this problem as well. I tried moving the line to yui menu() function, but then the menu does not work.

WilliamSiddall’s picture

Version: 5.x-2.2 » 5.x-1.x-dev

I've got the same problem as reported by jbowman. A brand new Drupal 5.3 install with just yui and yui-editor installed. 1.x-dev and 2.2 both show the problem. IE and Firefox both show the problem.

Jorrit’s picture

Same problem here ....

Strack trace:

Fatal error: Call to undefined function drupal_add_js() in /var/www/www.travelhome.nl/drupal5/sites/all/modules/yui/yui.module on line 33
Call Stack
# Time Memory Function Location
1 0.0002 51524 {main}( ) ../index.php:0
2 0.0015 210300 drupal_bootstrap( ) ../index.php:13
3 0.0062 408144 _drupal_bootstrap( ) ../bootstrap.inc:862
4 0.0076 486836 _drupal_cache_init( ) ../bootstrap.inc:906
5 0.0088 556740 bootstrap_invoke_all( ) ../bootstrap.inc:947
6 0.0113 761888 module_invoke( ) ../bootstrap.inc:486
7 0.0113 762056 call_user_func_array ( ) ../module.inc:386
8 0.0114 762184 yui_init( ) ../module.inc:0

On Drupal 5.6 and using Firefox

As a work-around, add require_once './includes/common.inc'; in yui.module/yui_init()

bakyildiz’s picture

Version: 5.x-1.x-dev » 5.x-2.0-dev
Status: Postponed (maintainer needs more info) » Fixed

Thanks to jorrit.

I have applied your work-around as advised. But while i can't produse the problem so i am not sure that this issue is solved. Can any one test the 2.0-dev version. I want to remind that drupal has to build the package first. So be sure that the package last modify time is after this entry. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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