From 73da7e8710d2f22802aa4da727fb88171389ddc7 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 20 Oct 2017 14:55:55 +0200 Subject: [PATCH] Prevent undefined errors on dashboard view Changeset c2b74d2ff7ed does not work for dashboard view, as it has no related screen and it does not have the same tab options as form tabs issue6867 review36721002 --- src/tab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tab.js b/src/tab.js index e31ebca75a..5c2edaf0b1 100644 --- a/src/tab.js +++ b/src/tab.js @@ -61,7 +61,8 @@ icon: 'glyphicon-time', label: Sao.i18n.gettext('View Logs...'), }, { - id: Sao.common.MODELHISTORY.contains(this.screen.model_name) ? + id: (this.screen && + Sao.common.MODELHISTORY.contains(this.screen.model_name)) ? 'revision': null, icon: 'glyphicon-time', label: Sao.i18n.gettext('Show revisions...'), @@ -197,7 +198,7 @@ group = null; return; } - if (!item.id) { + if (!item.id || !this[item.id]) { return; } if (!group) {