fixing TypeError stoping etemplate.test.contact_widget from displaying, because attribute "type" is not defined

maybe we dont want setting of undefined attributes, but then it should give a clear error (eg. exception)
--> https://localhost/egroupware/etemplate/inc/class.etemplate_new.inc.php?name=etemplate.test.contact_widget tests contact-widgets
This commit is contained in:
Ralf Becker 2011-08-25 20:09:45 +00:00
parent 502ac42923
commit fb62831e86

View File

@ -477,7 +477,7 @@
Class.prototype.initAttributes = function(_attrs) {
for (var key in _attrs)
{
if (!this.attributes[key].ignore && !(_attrs[key] == undefined))
if (typeof this.attributes[key] != "undefined" && !this.attributes[key].ignore && !(_attrs[key] == undefined))
{
this.setAttribute(key, _attrs[key], false);
}