Fix private custom field filtering

This commit is contained in:
Nathan Gray 2013-03-20 20:47:54 +00:00
parent a140cd1f25
commit 8c20d825cb
2 changed files with 10 additions and 4 deletions

View File

@ -199,7 +199,10 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
{
// This widget has different settings from global
$this->setElementAttribute($form_name, 'customfields', $fields);
$this->setElementAttribute($form_name, 'fields', array_fill_keys(array_keys($fields), true));
$this->setElementAttribute($form_name, 'fields', array_merge(
array_fill_keys(array_keys($customfields), false),
array_fill_keys(array_keys($fields), true)
));
}
parent::beforeSendToClient($cname);

View File

@ -103,10 +103,10 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
destroy: function() {
this._super.apply(this, arguments);
this.rows = {};
this.widgets = {};
this.detachedNodes = [];
this.tbody = null;
this.table = null;
this.rows = null;
this.widgets = null;
},
/**
@ -288,6 +288,9 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
if(!this.options.customfields) return;
for(var field_name in this.options.customfields)
{
// Skip fields if we're filtering
if(!jQuery.isEmptyObject(this.options.fields) && !this.options.fields[field_name]) continue;
// Make sure widget is created, and has the needed function
if(!this.widgets[field_name] || !this.widgets[field_name].set_value) continue;
var value = _value[this.prefix + field_name] ? _value[this.prefix + field_name] : null;