[TYPO3-core] RFC: #16646: help_aboutmoules hardcoded as start up module - returns error if uninstalled
Søren Malling
soren.malling at gmail.com
Fri Dec 3 06:12:15 CET 2010
My bug report, so I better be the first to test ;-)
+ 1 on testing, in case where aboutmodules is uninstalled
Haven't tried with the workspace usecase mentioned
Regards,
Søren Malling
TYPO3 Brugergruppe Danmark: www.typo3danmark.dk
Twitter: twitter.com/sorenmalling
On Fri, Dec 3, 2010 at 12:12 AM, Steffen Kamper <info at sk-typo3.de> wrote:
> Hi,
>
> This is an SVN patch request.
>
> Type: bugfix
>
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=16645
>
> Branches:
> Trunk
>
> There are some occasions where the defined startmodule is not present:
> * if startmodule is not installed
> * if startmodule is not visible after switching to workspace
> * if module store has no entries
>
> In these cases a console message is send. This was not the final solution
> anyway, so fix it with this patch
>
> in first and second situation jump to first available module instead,
> with third situation display a flashmessage.
>
> How to test:
> Switch to workspace having about_modules as startmodule (default)
>
> vg Steffen
>
> Index: typo3/js/modulemenu.js
> ===================================================================
> --- typo3/js/modulemenu.js (revision 9647)
> +++ typo3/js/modulemenu.js (revision )
> @@ -101,7 +101,9 @@
> callback: function(records, options) {
> this.renderMenu(records);
> if (top.startInModule) {
> -
> this.showModule(top.startInModule[0],top.startInModule[1]);
> +
> this.showModule(top.startInModule[0], top.startInModule[1]);
> + } else {
> + this.loadFirstAvailableModule();
> }
> }
> });
> @@ -196,17 +198,32 @@
> showModule: function(mod, params) {
> params = params || '';
> this.selecteModule = mod;
> +
> + params = this.includeId(mod, params);
> var record = this.getRecordFromName(mod);
>
> if (record) {
> + this.loadModuleComponents(record, params);
> + } else {
> + //defined startup module is not present, use
> the first available instead
> + this.loadFirstAvailableModule(params);
> + }
> + },
>
> - //get id
> - var section = mod.split('_')[0];
> - if (top.fsMod.recentIds[section]) {
> - params = 'id=' +
> top.fsMod.recentIds[section] + '&' + params;
> + loadFirstAvailableModule: function(params) {
> + params = params || '';
> + 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 {
> + mod =
> TYPO3.ModuleMenu.Store.getAt(0).data.sub[0];
> + this.loadModuleComponents(mod, params);
> }
> + },
>
> + loadModuleComponents: function(record, params) {
> + var mod = record.name;
> - if (record.navigationComponentId) {
> + if (record.navigationComponentId) {
>
> this.loadNavigationComponent(record.navigationComponentId);
>
> TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow',
> 'auto');
> } else if (record.navframe) {
> @@ -220,14 +237,20 @@
> this.loadedModule = mod;
> this.highlightModuleMenuItem(mod);
>
> - // compatibility
> + // compatibility
> top.currentSubScript = record.originalLink;
> top.currentModuleLoaded = mod;
>
> TYPO3.Backend.doLayout();
> - } else {
> - console.log(mod + ' was not found in modules');
> + },
> +
> + includeId: function(mod, params) {
> + //get id
> + var section = mod.split('_')[0];
> + if (top.fsMod.recentIds[section]) {
> + params = 'id=' +
> top.fsMod.recentIds[section] + '&' + params;
> - }
> + }
> + return params;
> },
>
> loadNavigationComponent: function(navigationComponentId) {
>
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
>
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core
>
More information about the TYPO3-team-core
mailing list