[BUGFIX] Page Tree not always updated after workspace actions 91/31091/3
authorOliver Hader <oliver@typo3.org>
Mon, 23 Jun 2014 18:34:59 +0000 (20:34 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 13 Aug 2014 14:17:36 +0000 (16:17 +0200)
After some workspace actions being performed in the workspaces
module in the TYPO3 Backend, the page tree does not get updated:
* discarding a single workspace version
* performing mass actions which output warnings

Resolves: #59828
Releases: 6.2, master
Change-Id: Ic9fb6613e8647ed351246ea18fcb3696e60ef7b2
Reviewed-on: http://review.typo3.org/31091
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/workspaces/Resources/Public/JavaScript/actions.js
typo3/sysext/workspaces/Resources/Public/JavaScript/helpers.js

index b657834..d868bac 100644 (file)
@@ -95,6 +95,7 @@ TYPO3.Workspaces.Actions = {
                        top.Ext.getCmp('executeMassActionCancleButton').setText(TYPO3.l10n.localize('close'));
                        top.Ext.getCmp('executeMassActionForm').show();
                        top.Ext.getCmp('executeMassActionForm').update(response.error);
+                       TYPO3.Workspaces.Helpers.refreshPageTree();
                } else {
                        if (response.total > response.processed) {
                                TYPO3.Workspaces.Actions.runMassAction(response);
@@ -104,7 +105,7 @@ TYPO3.Workspaces.Actions = {
                                top.Ext.getCmp('executeMassActionCancleButton').setText(TYPO3.l10n.localize('close'));
                                top.Ext.getCmp('executeMassActionForm').show();
                                top.Ext.getCmp('executeMassActionForm').update(TYPO3.l10n.localize('runMassAction.done').replace('%d', response.total));
-                               top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
+                               TYPO3.Workspaces.Helpers.refreshPageTree();
                        }
                }
        },
@@ -123,6 +124,7 @@ TYPO3.Workspaces.Actions = {
        },
        deleteSingleRecord: function(table, uid) {
                TYPO3.Workspaces.ExtDirectActions.deleteSingleRecord(table, uid, function(response) {
+                       TYPO3.Workspaces.Helpers.refreshPageTree();
                        TYPO3.Workspaces.MainStore.load();
                });
        },
@@ -152,7 +154,7 @@ TYPO3.Workspaces.Actions = {
                                        TYPO3.Workspaces.Actions.sendToStageExecute(parameters);
                                        top.TYPO3.Windows.close('sendToStageWindow');
                                        TYPO3.Workspaces.MainStore.reload();
-                                       top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
+                                       TYPO3.Workspaces.Helpers.refreshPageTree();
                                }
                        });
                }
index fc64332..554fc5c 100644 (file)
@@ -202,5 +202,11 @@ TYPO3.Workspaces.Helpers = {
                        pointer = pointer[item];
                });
                return result;
+       },
+
+       refreshPageTree: function() {
+               if (TYPO3.Workspaces.Helpers.isDefined('top.TYPO3.Backend.NavigationContainer.PageTree')) {
+                       top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
+               }
        }
-};
\ No newline at end of file
+};