On the front page of an empty site (rare, I know) section I get this error:
notice: Undefined variable: output in /path/to/drupal/sites/all/modules/ubercart/uc_cart/uc_cart.module on line 387.
notice: Undefined variable: output in /path/to/drupal/sites/all/modules/ubercart/uc_cart/uc_cart.module on line 427.
In the file uc_cart.module I can suppress this error by adjusting the following function:
373 function theme_uc_cart_block_content() {
374 global $user;
375 $output = ''; ************** added this line ***************
376 $total = ''; ************** added this line ***************
Both of these variables are only set initially under certain conditions. If a blank variable is added at the beginning of the function, the error does not occur.
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedHey emmajane, the cart block code was actually totally changed in the beta4. I checked it out, and I think it's initializing everything properly now, so hopefully you won't see this any more. Feel free to re-open if you're still getting the error after an update.
Comment #3
j0rd CreditAttribution: j0rd commentedThis bug also exists in the latest version of Drupal 5 - Ubercart 1.10
It's a problem because is provides you with a "null" Total in your cart block display.
Aka.
"Total: " instead of "Total: $0.00"
To resolve the issue as mentioned, $total variable has to be initialized by the begining of the function.
Comment #4
TR CreditAttribution: TR commentedOK, initialized $output and $total, for those of you still using Ubercart 1.x.