Hi,

I found a bug, jQuery Update doesn't work at page front (at least when you have one page-front.tpl.php).

This post talked about a replacement pattern, but it didn't work for me.
http://drupal.org/node/813918

is there any solution?

thanks

Comments

whayes’s picture

Could be this - http://drupal.org/node/797442 I had a problem with jQuery not loading and this took care of it (Comment #1)

beckyjohnson’s picture

I am having this problem too. I'm pretty at a loss as to what to do.

stackpr’s picture

Could be #893354: using drupal_get_js() inside tpl file breaks jquery_update. Do you call drupal_get_js() at any point in your front template or in your theme's template.php file?

beckyjohnson’s picture

I don't. I declare a js file in my .info file....

stackpr’s picture

Is there anything distinctive about your front page or is it just a node with a custom page template? If it uses panels or views, do other panels/views work correctly? Just to confirm, your problem is that the misc/jquery.js is included -- not that no scripts are included?

beckyjohnson’s picture

My front page is just a template file. with some custom html in it. I had to custom code the quick tabs on the front page. Also the rotating book covers are generated because I printed out a block in my template. http://industryeducation.right-brain.net/

Elements like this and the drop down menu at the top do not break inside the site....

Becky

stackpr’s picture

The recommended reading page (http://industryeducation.right-brain.net/rr/recommended-reading-developers) still shows misc/jquery.js, so the jquery_update does not seem to affect any page. Does that mean you have the module turned off right now?

Do you have a hook_preprocess_page() function with your theme? Does it interact with $scripts or with drupal_get_js()?

beckyjohnson’s picture

I do. i have this:

function intel_edu_preprocess_page(&$vars, $hook) {
    if (module_exists('taxonomy') && $vars['node']->nid) {
    foreach (taxonomy_node_get_terms($vars['node']) as $term) {
      $vars['node_terms'] = $vars['node_terms'] . ' taxonomy-' . strtolower(eregi_replace('[^a-z0-9]', '-', $term->name));
    }
  }
}

It does not interact with drupal_get_js or $scripts though. Just posting it here for reference.

stackpr’s picture

That looks fine (at least related to this). Do you have any pages where misc/jquery.js is actually being replaced? If so, can you link to that page too? Right now, it just looks like the module is just disabled sitewide (or is turned off via throttle?), but you suggest that the problem was only your front page. Perhaps you can add an HTTP header in jquery_update_preprocess_page() just to confirm that the function is actually being called? And if it is not being called, then perhaps you could add debug in the template to see whether the function even exists (i.e., whether the module was loaded).

beckyjohnson’s picture

That sounds like a good idea How do i add an HTTP header ? (I had to disable jquery update temporarily, boss's orders ).

stackpr’s picture

In Drupal, you'll usually use: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_se...
drupal_set_header("x-breakpoint-a: Yes");

The direct PHP function is header().

markhalliwell’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 reached EOL (end-of-life) on February 24, 2016.