Skip to content

Commit

Permalink
Merge branch 'pu/ss/fixappinittoearly' into '2024.11'
Browse files Browse the repository at this point in the history
fix(Tinebase): Application Starter tries to get App that is not initalized yet

See merge request tine20/tine20!5003
  • Loading branch information
pschuele committed Feb 26, 2024
2 parents 1c69537 + ac4fb6f commit 02c523c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tine20/Tinebase/js/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Tine.Tinebase.Application = function(config) {

this.hasMainScreen = Ext.isBoolean(this.hasMainScreen) ? this.hasMainScreen :
(this.getMainScreen != Tine.Tinebase.Application.prototype.getMainScreen ||
typeof Tine[this.appName].MainScreen === 'function');
typeof Tine[this.appName].MainScreen === 'function' );

this.hasMainScreen = this.hasMainScreen && Tine.Tinebase.common.hasRight('mainscreen', this.appName);

Expand Down
15 changes: 8 additions & 7 deletions tine20/Tinebase/js/ApplicationStarter.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ Ext.apply(Tine.Tinebase.ApplicationStarter,{
const appName = modelConfig.appName;
const modelName = modelConfig.modelName;
const owningAppName = _.get(fieldconfig, 'owningApp') || appName;
const app = Tine.Tinebase.appMgr.get(owningAppName);
if (! app) {

if (! Tine.Tinebase.appMgr.getInitialisedRecord(owningAppName)) {
Tine.log.error('Application ' + owningAppName + ' not found!');
return null;
}
Expand All @@ -309,17 +309,18 @@ Ext.apply(Tine.Tinebase.ApplicationStarter,{

var fieldTypeKey = (fieldconfig && fieldconfig.type) ? fieldconfig.type : (filterconfig && filterconfig.type) ? filterconfig.type : 'default',
label = (filterconfig && filterconfig.hasOwnProperty('label')) ? filterconfig.label : (fieldconfig && fieldconfig.hasOwnProperty('label')) ? fieldconfig.label : null,
globalI18n = ((filterconfig && filterconfig.hasOwnProperty('useGlobalTranslation')) || (fieldconfig && fieldconfig.hasOwnProperty('useGlobalTranslation'))),
i18n = globalI18n ? window.i18n : app.i18n;

globalI18n = ((filterconfig && filterconfig.hasOwnProperty('useGlobalTranslation')) || (fieldconfig && fieldconfig.hasOwnProperty('useGlobalTranslation')));

if (! label || _.get(fieldconfig, 'disabled') || _.get(fieldconfig, 'uiconfig.disabled') || _.get(filterOptions, 'disabled')) {
return null;
}
// prepare filter
var filter = {
label: i18n._hidden(label),
label,
owningAppName,
globalI18n,
field: fieldKey,
gender: i18n._hidden('GENDER_' + label),
gender: 'GENDER_' + label,
specialType: fieldconfig ? fieldconfig.specialType : null
};

Expand Down
4 changes: 4 additions & 0 deletions tine20/Tinebase/js/widgets/grid/FilterModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ Ext.extend(Tine.widgets.grid.FilterModel, Ext.util.Observable, {
// e.g. {name = 'someApp'}
this.app = Tine.Tinebase.appMgr.get(this.app);

const i18n = this.globalI18n ? window.i18n : (this.owningAppName ? Tine.Tinebase.appMgr.get(this.owningAppName) : this.app).i18n || window.i18n;
this.label = i18n._hidden(this.label);
this.gender = i18n._hidden(this.gender);

if (this.app) {
this.itemName = this.itemName || this.label;
this.label = this.app.i18n._hidden(this.label);
Expand Down

0 comments on commit 02c523c

Please sign in to comment.