Branch: Tag:

2006-12-06

2006-12-06 17:03:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed bug in render_form() where _name() was called on the result from _name().
Fixed several bugs in ProviderChoice. It might now even work!

Rev: server/etc/modules/Variable.pmod/module.pmod:1.97

1: - // $Id: module.pmod,v 1.96 2006/12/06 15:57:35 grubba Exp $ + // $Id: module.pmod,v 1.97 2006/12/06 17:03:22 grubba Exp $      #include <module.h>   #include <roxen.h>
1136:    // so no other value appears to be selected, and to ensure that    // the value doesn't change as a side-effect by another change.    res += " " + Roxen.make_container ( -  "option", (["value":_name(current), "selected": "selected"]), -  sprintf(LOCALE(332,"(keep stale value %s)"),_name(current))); +  "option", (["value": current, "selected": "selected"]), +  sprintf(LOCALE(332,"(keep stale value %s)"), current));    return res + "</select>";    }   
1357:    static Configuration conf;    static string provides;    static string default_id; -  static string local_id; +  static string local_id = "";       int low_set(RoxenModule to)    {
1369:    {    RoxenModule res = ::query();    if (!res) { -  if (local_id) { +  if (local_id != "") {    // The module might have been reloaded.    // Try locating it again.    res = transform_from_form(local_id); -  } else { -  res = default_value(); +  if (res) low_set(res);    } -  if (res || local_id) low_set(res); +     }    return res;    }
1393:       static string _title(RoxenModule val)    { -  return val?val->query_name():""; +  return val?val->module_name:"";    }       RoxenModule transform_from_form(string local_id, mapping|void v)