field manager fix
This commit is contained in:
@@ -121,6 +121,8 @@ class FieldManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
$this->getContainer()->get('fieldManager')->resetToDefault($data->scope, $data->name);
|
||||
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuildMetadata();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -354,7 +354,7 @@ class Language
|
||||
|
||||
$cacheFile = $this->getCacheFile($language);
|
||||
|
||||
if (!$this->useCache || !file_exists($cacheFile)) {
|
||||
if (!$this->useCache || !file_exists($cacheFile) || $reload) {
|
||||
|
||||
$paths = $this->paths;
|
||||
|
||||
@@ -368,11 +368,12 @@ class Language
|
||||
|
||||
$data = $this->getUnifier()->unify('i18n', $paths, true);
|
||||
|
||||
if (is_array($data))
|
||||
if (is_array($data)) {
|
||||
$this->sanitizeData($data);
|
||||
}
|
||||
|
||||
if ($language != $this->defaultLanguage) {
|
||||
$data = Util::merge($this->getDefaultLanguageData(), $data);
|
||||
$data = Util::merge($this->getDefaultLanguageData($reload), $data);
|
||||
}
|
||||
|
||||
$this->data[$language] = $data;
|
||||
|
||||
@@ -116,7 +116,8 @@ define('language', ['ajax'], function (Ajax) {
|
||||
},
|
||||
|
||||
load: function (callback, disableCache, loadDefault) {
|
||||
this.once('sync', callback);
|
||||
if (callback)
|
||||
this.once('sync', callback);
|
||||
|
||||
if (!disableCache) {
|
||||
if (this.loadFromCache(loadDefault)) {
|
||||
@@ -129,7 +130,7 @@ define('language', ['ajax'], function (Ajax) {
|
||||
},
|
||||
|
||||
fetch: function (disableCache, loadDefault) {
|
||||
Ajax.getRequest(this.url, {default: loadDefault}).then(function (data) {
|
||||
return Ajax.getRequest(this.url, {default: loadDefault}).then(function (data) {
|
||||
this.data = data;
|
||||
if (!disableCache) {
|
||||
this.storeToCache(loadDefault);
|
||||
|
||||
@@ -46,19 +46,22 @@ define('metadata', [], function () {
|
||||
load: function (callback, disableCache, sync) {
|
||||
var sync = (typeof sync == 'undefined') ? false: sync;
|
||||
this.off('sync');
|
||||
this.once('sync', callback);
|
||||
|
||||
if (callback)
|
||||
this.once('sync', callback);
|
||||
|
||||
if (!disableCache) {
|
||||
if (this.loadFromCache()) {
|
||||
this.trigger('sync');
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.fetch(sync);
|
||||
return this.fetch(sync);
|
||||
},
|
||||
|
||||
fetch: function (sync) {
|
||||
var self = this;
|
||||
this.ajax({
|
||||
return this.ajax({
|
||||
url: this.url,
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
|
||||
@@ -424,8 +424,9 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep,
|
||||
}.bind(this)),
|
||||
new Promise(function (resolve) {
|
||||
this.getLanguage().load(function () {
|
||||
this.getLanguage().storeToCache();
|
||||
resolve();
|
||||
}, true);
|
||||
}.bind(this), true);
|
||||
}.bind(this))
|
||||
]).then(function () {
|
||||
this.trigger('after:save');
|
||||
@@ -501,6 +502,7 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep,
|
||||
}.bind(this)),
|
||||
new Promise(function (resolve) {
|
||||
this.getLanguage().load(function () {
|
||||
this.getLanguage().storeToCache();
|
||||
resolve();
|
||||
}.bind(this), true);
|
||||
}.bind(this))
|
||||
@@ -513,8 +515,7 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep,
|
||||
}.bind(this));
|
||||
|
||||
}, this);
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user