Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Neos redirection issue in subfolder configuration #3713

Merged
merged 5 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}) {
markusguenther marked this conversation as resolved.
Show resolved Hide resolved
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
Loading