Use of undeclared variable

kiamlaluno - July 31, 2008 - 15:58
Project:Condition(s)
Version:6.x-2.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

In condition_selection_form() the code checks the value of a variable which is not defined in the function, nor it is declared like global.

<?php
function condition_selection_form($context) {   
 
$conditions = condition_load();
 
 
// We might get just the values instead of the form_state.
 
if ($form_state['conditions']) {
   
$form_state['values'] = $form_state;
  }
 
 
// ...
?>

I would guess the function forgets to declare the other parameter, and it should be written so:

<?php
function condition_selection_form(&$form_state, $context) {   
 
$conditions = condition_load();
 
 
// We might get just the values instead of the form_state.
 
if ($form_state['conditions']) {
   
$form_state['values'] = $form_state;
  }
 
 
// ...
?>

 
 

Drupal is a registered trademark of Dries Buytaert.