Undefined variable in uc_order.order_pane.inc:_order_pane_list()

freixas - February 24, 2009 - 16:28
Project:Ubercart
Version:6.x-2.0-beta4
Component:Code
Category:bug report
Priority:normal
Assigned:rszrama
Status:closed
Description

The variable $action in the code below is referenced without ever being defined.

<?php
/**
* Build a list of order panes defined in the enabled modules.
*/
function _order_pane_list($view = 'view') {
  static
$panes;

  if (
count($panes) > 0 && $action !== 'rebuild') {
    return
$panes;
  }
?>

Note: I've been going to commons.inc and changing the error reporting to E_ALL (without ^ E_NOTICE) to find a lot of these errors (I'm assuming it's a leftover from the D5 - D6 conversion) in my own module.

#1

rszrama - February 24, 2009 - 21:00
Assigned to:Anonymous» rszrama

#2

cha0s - April 20, 2009 - 17:44
Status:active» needs review

Figured I'd put a patch up...

AttachmentSize
382486.pane_rebuild.2.x.patch 439 bytes

#3

freixas - April 20, 2009 - 19:48

Looks good to me, but I have no idea what the possible values of $view are, nor what 'rebuild' should do. The API documentation is not very helpful.

#4

cha0s - April 20, 2009 - 20:26

FWIW, I'm not sure the 'rebuild' option is ever actually used in the code in this case. It may have just been a forward-thinking thing.

'customer', 'view', 'edit', invoice' are among currently used values for $view.

(I realize documentation will need to be updated, but let's wait until the first issue is resolved, then we can send it over to Doc and get that taken care of when the code is in)

#5

rszrama - April 23, 2009 - 04:33
Status:needs review» fixed

$view should not be used in this way; it indicates on which type of page the order is being represented... 'view', 'edit', etc. I don't claim to remember all the ins and outs here. More likely, it looks like I decided I didn't ever need to empty the static cache. Dunno why, but since it's operating that way, we can just remove the check for $action == 'rebuild' altogether and go on our way. Suffice it to say, the panes system are horribly outdated and are on my "this needs to be fixed" list.

#6

System Message - May 7, 2009 - 04:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.