Branch: Tag:

2006-05-31

2006-05-31 13:38:03 by Jonas Wallden <jonasw@roxen.com>

Select overrides must cope with double variables in form submission.

Rev: server/base_server/wizard.pike:1.164

2:   // Copyright © 1997 - 2004, Roxen IS.   //   // Wizard generator - // $Id: wizard.pike,v 1.163 2006/05/30 12:52:35 jonasw Exp $ + // $Id: wizard.pike,v 1.164 2006/05/31 13:38:03 jonasw Exp $      /* wizard_automaton operation (old behavior if it isn't defined):   
564:    m2->value = current;    }    -  selector += "&nbsp;" + make_tag("input", m2); +  selector += +  "&nbsp;" + make_tag("input", m2) + +  "<input type='hidden' name='__select_override_vars' " +  " value='" + m2->name + ":" + m->select_override + "' />";    }       return selector;
808:    foreach(indices(s), string q)    å[q] = å[q]||s[q];    +  // Handle double posting of variables in select override widgets +  foreach(Array.uniq(id->real_variables->__select_override_vars || ({ }) ), +  string override_combo) { +  [string override_var, string override_marker] = override_combo / ":"; +  array(string) override_info = id->real_variables[override_var]; +  if (sizeof(override_info) > 1) { +  string override_value = override_info[0]; +  if (override_value != override_info[1]) { +  if (override_value == override_marker) { +  override_value = override_info[1]; + #if 0 +  } else if (override_info[1] == override_marker) { +  /* Already ok. */ +  } else { +  /* Ambiguous case. Warn? */ + #endif /* 0 */ +  } +  } +  id->real_variables[override_var] = ({ override_value }); +  } +  } +     FakedVariables v=id->variables;       int current_page = (int) v->_page;