[RESOLVED] Cart Block not collapsed

Project: 
Ubercart
Category: 
bug report
Version: 
Ubercart 1.x-dev
Priority: 
normal
Status: 
fixed

Hey guys,

Just upgraded to the latest bzr dev version of the module. Everything seems to work well except the cart block is not getting collapsed, even though I have it configured to appear as collapsed by default.

Looking at the source code, uc_cart_block.js isn't being loaded into the template. Not sure what would cause that... all other JS seems to work fine (including at checkout) so it doesn't seem to be browser or javascript-related. I am using a slightly older version of jQuery, but I don't think that would do it. Suggestions?

www.rifftrax.com is where the issue appears.

Re: Cart Block not collapsed

Weird... I don't believe anything has changed in there since RC5. The block function should be adding that JS just like any other JS. The site's offline or I'd give it a glance.

Re: Cart Block not collapsed

There was a small change in JS handling between RC4 and 1.0 - I don't know if it's the cause of your problem but it's something to look at. Basically, Ubercart now uses uc_add_js() to add the JS to the page - this is just a wrapper around drupal_add_js() which attaches a timestamp to the JS name so that when the JS changes the filename changes so you don't have to worry about the web browser or Drupal caching and using the old version. So in Firebug you should see something like uc_cart_block.js?79487 being loaded. I don't know if this might break your page template or your template.php code?

Have you flushed your browser cache and your Drupal cache?

Re: Cart Block not collapsed

It's back online now. We're having some issues with Views and VotingAPI - there seems to be a table missing, and so it's breaking our Catalogue views.

Anyways the JS issue still appears, so take a look Smiling

Re: Re: Cart Block not collapsed

So, I can't even reproduce this on my dev box, but it might be because I haven't updated the dev server to Drupal 5.8 yet. I updated some other modules, but none that I imagine would affect the javascript being added.

That is the issue - for whatever reason, the block's 'view' $op isn't being called. I created a page that forces this behavior - (The) Cart - and the behavior works fine. All the source code for that page is the few uc_add_js() lines, surrounded by the conditionals just as they appear in uc_cart.module.

So I'm stumped but still looking into it.

Re: Re: Re: Cart Block not collapsed

After hacking the uc_cart.module file, it turns out that the 'view' $op is getting called after all. So that's not the problem. The problem is that the uc_add_js() function is not getting called, but I don't know the cause of that. There are no errors in the log, nothing in Firebug to alert me to the issue, nothing. Just an expanded cart. *headdesk*

Re: Re: Re: Re: Cart Block not collapsed

I just don't know... it almost appears like the 'view' $op isn't getting called b/c if you look you're also not getting uc_cart.css added either. Of course, that's weird since it's actually showing up on the page... you don't have a custom cart block anywhere, do you? Sticking out tongue

Re: Re: Re: Re: Re: Cart Block not collapsed

Nope, no custom cart hooks that I'm aware of. Could there be a rogue file somewhere? During the upgrade I deleted the entire ubercart directory, and then untarred the snapshot build. But again, the snapshot build isn't the problem since I can't reproduce it with the same tarball on our dev box.

I will note that I upgraded a bunch of other modules at the same time as this (including Drupal to 5.Cool.. so... I wouldn't be surprised if it's related to that somehow. It's a mystery, wrapped in an enigma.

Re: Re: Re: Re: Re: Re: Cart Block not collapsed

Wow - I have a tip for torgosPizza...
No mystery, read Site updated to Drupal 5.8, there is an issue with Drupal 5.8 about loading css & js files.

Related links on d.o (found on the above link):
block module from 5.8 breaks css and js (reverting to 5.7 block.module fixes problem) and
block_list() renders all blocks, even on 404

Hope this helps, Al

Re: Re: Re: Re: Re: Re: Re: Cart Block not collapsed

You, sir, are a god among men. I'm surprised I didn't find this myself but I was just getting back to troubleshooting when I saw your post.

It's fixed for me, so I'm changing this to fixed. Hopefully it'll help others when they update.

Thanks again, Al.

Re: Re: Re: Re: Re: Re: Re: Re: Cart Block not collapsed

It was a pleasure to me, I will send the link to your comment to the real god who posted the link to me Smiling

BTW - a real patch seems to be available at regression in 5.8 from 5.7 theme('blocks','all') broken - so no header alteration possible, unfortunately just for PHP>=5.2.0

Still not working with 5.9

[UPDATE]
Bah! False alarm, I guess. I trashed the whole install and copied 5.9 in clean. Connected to my database and restored my files and sites directories. Everything works again.

I thought it might have been the jquery-update module but it still works after enabling that on the fresh install. Not sure exactly what happened but it's fixed so that's all that matters.

Sorry for wasting your time.
======================================

Maybe I missed something but the js is still not loading in my cart block after upgrade to 5.9.

I was a bit behind and did a 2 step upgrade 5.7 -> 5.8 -> 5.9

Also updated to Ubercart 5.x-1.3.

I've tried clearing caches. Cart block still won't collapse. Did I forget something? Any suggestions?