Skip to content

Commit

Permalink
BUGFIX: Neos redirection issue in subfolder configuration (neos#3713)
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther committed Feb 11, 2024
1 parent 38774df commit 53548fe
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- run: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
- run: chmod +x ~/.nvm/nvm.sh
- run:
no_output_timeout: 20m
no_output_timeout: 30m
command: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Expand Down
6 changes: 6 additions & 0 deletions Resources/Private/Fusion/Backend/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ backend = Neos.Fusion:Template {
module = 'media/browser'
}
}
defaultModule = Neos.Fusion:UriBuilder {
package = 'Neos.Neos'
controller = 'Backend\\Backend'
action = 'index'
absolute = true
}
}
login = Neos.Fusion:UriBuilder {
controller = 'Login'
Expand Down
1 change: 1 addition & 0 deletions packages/neos-ui-backend-connector/src/Endpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface Routes {
workspaces: string;
userSettings: string;
mediaBrowser: string;
defaultModule: string;
};
login: string;
logout: string;
Expand Down
5 changes: 3 additions & 2 deletions packages/neos-ui-sagas/src/UI/Impersonate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {actionTypes, actions} from '@neos-project/neos-ui-redux-store';
import backend from '@neos-project/neos-ui-backend-connector';
import {$get} from 'plow-js';

export function * impersonateRestore({globalRegistry}) {
export function * impersonateRestore({globalRegistry, routes}) {
const {impersonateRestore} = backend.get().endpoints;
const i18nRegistry = globalRegistry.get('i18n');
const errorMessage = i18nRegistry.translate(
Expand Down Expand Up @@ -38,7 +38,8 @@ export function * impersonateRestore({globalRegistry}) {
} else {
yield put(actions.UI.FlashMessages.add('restoreUserImpersonateUser', errorMessage, 'error'));
}
window.location.pathname = '/neos';

window.location.href = $get('core.modules.defaultModule', routes);
} catch (error) {
yield put(actions.UI.FlashMessages.add('restoreUserImpersonateUser', errorMessage, 'error'));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/neos-ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function * application() {
//
// Bootstrap the saga middleware with initial sagas
//
globalRegistry.get('sagas').getAllAsList().forEach(element => sagaMiddleWare.run(element.saga, {store, globalRegistry, configuration}));
globalRegistry.get('sagas').getAllAsList().forEach(element => sagaMiddleWare.run(element.saga, {store, globalRegistry, configuration, routes}));

//
// Tell everybody, that we're booting now
Expand Down
6 changes: 3 additions & 3 deletions packages/neos-ui/src/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import initializeContentDomNode from '@neos-project/neos-ui-guest-frame/src/init
import style from '@neos-project/neos-ui-guest-frame/src/style.css';
import backend from '@neos-project/neos-ui-backend-connector';

manifest('main', {}, globalRegistry => {
manifest('main', {}, (globalRegistry, {routes}) => {
//
// Create edit preview mode registry
//
Expand Down Expand Up @@ -291,7 +291,7 @@ manifest('main', {}, globalRegistry => {
// This is an extreme case when even the top node does not exist in the given dimension
// TODO: still find a nicer way to break out of this situation
if (redirectContextPath === false) {
window.location = '/neos';
window.location.href = $get('core.modules.defaultModule', routes);
break;
}
redirectUri = $get(['cr', 'nodes', 'byContextPath', redirectContextPath, 'uri'], state);
Expand Down Expand Up @@ -360,7 +360,7 @@ manifest('main', {}, globalRegistry => {
// This is an extreme case when even the top node does not exist in the given dimension
// TODO: still find a nicer way to break out of this situation
if (!redirectContextPath) {
window.location = '/neos';
window.location.href = $get('core.modules.defaultModule', routes);
break;
}
redirectUri = $get(['cr', 'nodes', 'byContextPath', redirectContextPath, 'uri'], state);
Expand Down

0 comments on commit 53548fe

Please sign in to comment.