Etemplate: Fix customfield widget bug "Cannot read property ... of undefined"

This commit is contained in:
nathangray 2020-03-05 15:37:42 -07:00
parent 9b2e6b5012
commit aa87e60f10
2 changed files with 6 additions and 3 deletions

View File

@ -196,8 +196,9 @@ var et2_customfields_list = /** @class */ (function (_super) {
if (['select', 'radio', 'radiogroup', 'checkbox', 'button'].indexOf(field.type) == -1 && !jQuery.isEmptyObject(field.values)) {
var w = et2_registry[attrs.type ? attrs.type : field.type];
for (var attr_name in field.values) {
if (typeof w.prototype.attributes[attr_name] != "undefined")
if (typeof w._attributes[attr_name] != "undefined") {
attrs[attr_name] = field.values[attr_name];
}
}
}
// Create widget

View File

@ -272,8 +272,10 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
const w = et2_registry[attrs.type ? attrs.type : field.type];
for(let attr_name in field.values)
{
if (typeof w.prototype.attributes[attr_name] != "undefined")
attrs[attr_name] = field.values[attr_name];
if (typeof w._attributes[attr_name] != "undefined")
{
attrs[attr_name] = field.values[attr_name];
}
}
}
// Create widget