Skip to content

Commit

Permalink
fix(Tinebase/js): skip rendering if keyfield config not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ccheng-dev committed Mar 20, 2024
1 parent b3cb6c0 commit 1028c92
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tine20/Tinebase/js/widgets/keyfield/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ Tine.Tinebase.widgets.keyfield.Renderer = function(){
what = what ? what : 'text|icon',
whatParts = what.split('|'),
key = appName + keyFieldName + what;
} catch (e) {
Tine.log.error(e);
}

if (! renderers[key]) {
renderers[key] = function(id) {
if (! id) return "";
var record = store.getById(id),
i18nValue = record ? record.get('i18nValue') : app.i18n._hidden(id),
icon = record ? record.get('icon') : null,
string = '';
if (! renderers[key]) {
renderers[key] = function(id) {
if (! id) return "";
var record = store.getById(id),
i18nValue = record ? record.get('i18nValue') : app.i18n._hidden(id),
icon = record ? record.get('icon') : null,
string = '';

if (whatParts.indexOf('icon') > -1 && icon) {
string = string + '<img src="' + icon + '" class="tine-keyfield-icon" ext:qtip="' + Ext.util.Format.htmlEncode(i18nValue) + '" />';
}
if (whatParts.indexOf('icon') > -1 && icon) {
string = string + '<img src="' + icon + '" class="tine-keyfield-icon" ext:qtip="' + Ext.util.Format.htmlEncode(i18nValue) + '" />';
}

if (whatParts.indexOf('text') > -1 && i18nValue) {
string = string + Ext.util.Format.htmlEncode(i18nValue);
}

if (whatParts.indexOf('text') > -1 && i18nValue) {
string = string + Ext.util.Format.htmlEncode(i18nValue);
return string;
}

return string;
}

return renderers[key];
} catch (e) {
Tine.log.error(e);
}

return renderers[key];
},

/**
Expand Down

0 comments on commit 1028c92

Please sign in to comment.