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
updateLink versioned extension regression on dev/build #8110
Comments
tractorcow
pushed a commit
to open-sausages/silverstripe-cms
that referenced
this issue
Jun 1, 2018
tractorcow
pushed a commit
to open-sausages/silverstripe-framework
that referenced
this issue
Jun 1, 2018
This was referenced Jun 1, 2018
I've fixed this with the suggested adjustment, but also reset the "default" stage to draft in dev/build in order to prevent other links being generated with querystring args. This is the same approach we used in LeftAndMain to prevent stage args in the CMS. |
tractorcow
pushed a commit
to open-sausages/silverstripe-framework
that referenced
this issue
Jun 1, 2018
tractorcow
pushed a commit
to open-sausages/silverstripe-cms
that referenced
this issue
Jun 4, 2018
tractorcow
pushed a commit
to open-sausages/silverstripe-framework
that referenced
this issue
Jun 4, 2018
tractorcow
pushed a commit
to open-sausages/silverstripe-cms
that referenced
this issue
Jun 4, 2018
tractorcow
pushed a commit
to open-sausages/silverstripe-framework
that referenced
this issue
Jun 5, 2018
maxime-rainville
pushed a commit
to silverstripe/silverstripe-cms
that referenced
this issue
Jun 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affected Version
3.x-dev
Description
When running a
dev/build
via the browser on an empty database (or specifically without anyErrorPage
records when using the CMS module) the user is logged out and sent back to/Security/login?BackURL=%2Fpage-not-found%2F%3Fstage%3DStage
Expected behaviour: for
dev/build
to complete successfully.I've narrowed this down to the following:
DevelopmentAdmin::init()
callsVersioned::reading_stage('Stage');
(silverstripe-framework/dev/DevelopmentAdmin.php
Lines 76 to 79 in 47a9cdf
VersionedStateExtension::updateLink()
appendsstage=Stage
to links when the object was queried from the draft stage (silverstripe-framework/model/VersionedStateExtension.php
Lines 23 to 48 in 47a9cdf
?stage=Stage
will still be appended to the URL.ErrorPage::requireDefaultRecords()
usesDirector::test()
to "statically publish" the error pages it generates (https://github.com/silverstripe/silverstripe-cms/blob/12826b2ace76808d29b5017e1f445514b7fcf62a/code/model/ErrorPage.php#L116)VersionedRequestFilter::preRequest()
takes outputting responses into it's own hands instead of returning a boolean responseVersionedRequestFilter::preRequest()
saves the dummy session fromDirector::test()
which causes the current session to be invalidated and the user logged outSteps to Reproduce
dev/build
in the browserPotential fix
I've fixed this locally by wrapping the
ErrorPage::requireDefaultRecords()
logic inVersioned::reading_stage(Versioned::LIVE);
which fixes the specific error, but I feel this only resolves part of the issue.Another fix could be to strip the
?stage
query param from$page->Link()
inErrorPage::requireDefaultRecords()
I've opened this against framework instead of CMS because most of the root issues are in framework and the PR to framework caused this regression
PRs:
The text was updated successfully, but these errors were encountered: