When activating cache in "normal" mode (most probably in "aggressive" mode too), the site becomes unaccessible for unregistered users with the following message:

"Fatal error: Call to undefined function: drupal_add_js() in /home/user/www/modules/yui/yui.module on line 33".

There was a similar problem in the gallery module which was fixed in 5.x-2.2: http://drupal.org/node/224598

Comments

bakyildiz’s picture

Assigned: Unassigned » bakyildiz

Thanks for reference. Please try the yui version 2.3. Please feed back.

iwankgb’s picture

I've just updated yui and yui_menu, enabled normal caching and everything seems to be fine :]

bakyildiz’s picture

Version: 5.x-2.2 » 5.x-2.3
Status: Active » Fixed
bakyildiz’s picture

Version: 5.x-2.3 » 6.x-1.1-1

Fixed. Use yui 6.x-1.1-1 and yuimenu 6.x-1.1-1

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

mustafau’s picture

Version: 6.x-1.1-1 » 5.x-2.0-dev
Status: Closed (fixed) » Needs review

I think this issue was fixed in a wrong way. You should not include common.inc inside a module file. That will lead to performance issues. Instead you should read suggested fix at http://api.drupal.org/api/function/hook_init/5.

bakyildiz’s picture

One point is not clear in my mind. Should i remove the yui_init() function and move the 2 lines to yui_menu() like as follows ? Should it before the if($may_cache) line or after ? By the way many thanks for your advanced support.


function yui_menu($may_cache) {
  $skin = variable_get('yui_skin', 'yui-skin-sam');
  drupal_add_js("if (Drupal.jsEnabled) { $(document).ready(function() { $('body').addClass('$skin'); } ); };", "inline");  
  $items = array();
  if ($may_cache) {
    $items[] = array(
  ...
  ...
mustafau’s picture

function yui_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
  ...
  }
  else {
    $skin = variable_get('yui_skin', 'yui-skin-sam');
    drupal_add_js("if (Drupal.jsEnabled) { $(document).ready(function() { $('body').addClass('$skin'); } ); };", "inline"); 
  }
  ...
bakyildiz’s picture

Version: 5.x-2.0-dev » 5.x-1.x-dev
Status: Needs review » Fixed

Fixed in 5.x-1.x-dev and will ready in next release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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