Skip to content
Snippets Groups Projects
Commit 54f35c3c authored by Oliver Hader's avatar Oliver Hader Committed by Jigal van Hemert
Browse files

[BUGFIX] Showmodule cannot be called before Store is loaded

Example: Using the direct page edit feature (backend.php?edit=xxx)
the BE responds with "Module loader No module found. If this is a
temporary error, please reload the Backend!" error.

Since the AJAX request is not finished at the time this is called,
it has to be checked whether the store was completely loaded.

Change-Id: Ia7c39fc94e75ef003a7a839856ea78cbd0854a66
Releases: 4.6,4.5
Resolves: #28951
Reviewed-on: http://review.typo3.org/5681
Reviewed-by: Helmut Hummel
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Tested-by: Jigal van Hemert
parent ebc80679
No related merge requests found
......@@ -50,6 +50,19 @@ TYPO3.ModuleMenu.Store = new Ext.data.JsonStore({
url: 'ajax.php?ajaxID=ModuleMenu::getData',
baseParams: {
'action': 'getModules'
},
listeners: {
beforeload: function(store) {
this.loaded = false;
},
load: function(store) {
this.loaded = true;
}
},
// Custom indicator for loaded store:
loaded: false,
isLoaded: function() {
return this.loaded;
}
});
......@@ -213,7 +226,13 @@ TYPO3.ModuleMenu.App = {
loadFirstAvailableModule: function(params) {
params = params || '';
if (TYPO3.ModuleMenu.Store.getCount() === 0) {
if (TYPO3.ModuleMenu.Store.isLoaded() === false) {
new Ext.util.DelayedTask(
this.loadFirstAvailableModule,
this,
[params]
).delay(250);
} else if (TYPO3.ModuleMenu.Store.getCount() === 0) {
// Store is empty, something went wrong
TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Module loader', 'No module found. If this is a temporary error, please reload the Backend!', 50000);
} else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment