-
Notifications
You must be signed in to change notification settings - Fork 96
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
4.2 use_session option prevents react admin areas loading #607
Comments
Thanks for the bug report and the detailed instruction. That was really easy to follow. I've confirmed in @chillu I'm setting the priority to high as this makes the asset-admin area unusable after you've access a draft page. Looks like this also broke versionned-admin silverstripe/silverstripe-versioned-admin#51. Might be worthwhile doing more testing |
It breaks Campaign-Admin as well. |
Right - so it's breaking versioned-admin as well, essentially everything that uses this API |
I'm thinking of updating public function updateLink(&$link)
{
// Skip if current mode matches default mode
// See LeftAndMain::init() for example of this being overridden.
$readingMode = $this->getReadingmode();
if ($readingMode === Versioned::get_default_reading_mode()) {
return;
}
// Determine if query args are supported for the current mode
$queryargs = ReadingMode::toQueryString($readingMode);
if (!$queryargs) {
return;
}
// Don't touch Admin/CMS links
if (class_exists(LeftAndMain::class) && $this->getOwner() instanceof LeftAndMain) {
return false;
}
// Decorate
$link = Controller::join_links(
$link,
'?' . http_build_query($queryargs)
);
} |
Just a usage note that is related. We created a link to asset admin from a dev task (using
|
4.2 has the option to keep using sessions to persist the current stage using this config:
When this is set, the react-based areas such as asset admin do not load.
This is caused by
getCombinedClientConfig
returning the url for the admin section with stage query params attached (eg/assets/admin?stage=Stage
). This means that admin'sBootRoutes.js
fails to match this route as a react-based route (matchesReactRoute
line 71) and instead starts the legacy router.I'm not 100% sure but I think this stems from LeftAndMain's
init
method, as it tries to set the reading mode to the same as the default reading mode to avoid having the stage param in the cms. When using session, this process is interrupted or changed before the config is generated and as a result the url is incorrect.To reproduce in 4.2 installation:
/?stage=Stage
)/admin/assets
, note that thewindow.ss.config
has urls with query parameters set.PRs
The text was updated successfully, but these errors were encountered: