From 5dc798da7f043436b512b5d73970df4acf25a16d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 10 May 2016 17:12:39 +0000 Subject: [PATCH] Fix customfield column sometimes disappearing from print --- api/js/etemplate/et2_extension_nextmatch.js | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index ba4bfe1ba6..d294805207 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -2061,20 +2061,22 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ if(col.visibility === ET2_COL_VISIBILITY_VISIBLE) columns_selected.push(colName); } // Custom fields get listed separately - if(widget.instanceOf(et2_nextmatch_customfields) && col.visibility === ET2_COL_VISIBILITY_VISIBLE) + if(widget.instanceOf(et2_nextmatch_customfields)) { - if(jQuery.isEmptyObject(widget.customfields)) + delete(columns[colName]); + colName = widget.id; + if(col.visibility === ET2_COL_VISIBILITY_VISIBLE && ! + jQuery.isEmptyObject(widget.customfields) + ) { - // No customfields defined, don't show column - delete(columns[colName]); - continue; - } - for(var field_name in widget.customfields) - { - columns[widget.prefix+field_name] = " - "+widget.customfields[field_name].label; - if(widget.options.fields[field_name] && columns_selected.indexOf(colName) >= 0) + columns[colName] = col.caption; + for(var field_name in widget.customfields) { - columns_selected.push(et2_customfields_list.prototype.prefix+field_name); + columns[widget.prefix+field_name] = " - "+widget.customfields[field_name].label; + if(widget.options.fields[field_name] && columns_selected.indexOf(colName) >= 0) + { + columns_selected.push(et2_customfields_list.prototype.prefix+field_name); + } } } }