From 31f20d9783de59700baec6c42f59444979db247f Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 16 Jun 2020 10:58:03 -0600 Subject: [PATCH] Etemplate: Fix history widget lost some widgets when converted to TypeScript --- api/js/etemplate/et2_widget_historylog.js | 2 +- api/js/etemplate/et2_widget_historylog.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_historylog.js b/api/js/etemplate/et2_widget_historylog.js index 4767099e47..6e52d35d8f 100644 --- a/api/js/etemplate/et2_widget_historylog.js +++ b/api/js/etemplate/et2_widget_historylog.js @@ -428,7 +428,7 @@ var et2_historylog = /** @class */ (function (_super) { value = _data['share_email']; } // Get widget from list, unless it needs a diff widget - if (typeof widget == 'undefined' && typeof self.fields[_data.status] != 'undefined' && (i < et2_historylog.NEW_VALUE || + if ((typeof widget == 'undefined' || widget == null) && typeof self.fields[_data.status] != 'undefined' && (i < et2_historylog.NEW_VALUE || i >= et2_historylog.NEW_VALUE && (self.fields[_data.status].nodes || !self._needsDiffWidget(_data['status'], _data[et2_historylog.columns[et2_historylog.OLD_VALUE].id])))) { widget = self.fields[_data.status].widget; if (!widget._children.length) { diff --git a/api/js/etemplate/et2_widget_historylog.ts b/api/js/etemplate/et2_widget_historylog.ts index 12982ca73d..67db95d072 100644 --- a/api/js/etemplate/et2_widget_historylog.ts +++ b/api/js/etemplate/et2_widget_historylog.ts @@ -592,7 +592,7 @@ export class et2_historylog extends et2_valueWidget implements et2_IDataProvider value = _data['share_email']; } // Get widget from list, unless it needs a diff widget - if(typeof widget == 'undefined' && typeof self.fields[_data.status] != 'undefined' && ( + if((typeof widget == 'undefined' || widget == null) && typeof self.fields[_data.status] != 'undefined' && ( i < et2_historylog.NEW_VALUE || i >= et2_historylog.NEW_VALUE && ( self.fields[_data.status].nodes || !self._needsDiffWidget(_data['status'], _data[et2_historylog.columns[et2_historylog.OLD_VALUE].id])