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

fix Versioned::choose_site_stage() if no request given #8154

Merged
merged 2 commits into from Jun 13, 2018

Conversation

xini
Copy link
Contributor

@xini xini commented Jun 9, 2018

Load request from current controller as a fallback if none is given.

Several modules break because previous version of choose_site_stage() didn't need the request.

Load request from curent controller as a fallback
@@ -1216,7 +1216,7 @@ public static function can_choose_site_stage($request) {
*/
public static function choose_site_stage(SS_HTTPRequest $request = null) {
if (!$request) {
throw new InvalidArgumentException("Request not found");
$request = Controller::curr()->getRequest();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check Controller::has_curr() first since there isn't always a current controller.

@xini
Copy link
Contributor Author

xini commented Jun 11, 2018

@tractorcow , I have added that check. Thanks!

@tractorcow
Copy link
Contributor

Not sure if test failure is related. Re-starting test on 3.7 branch at https://travis-ci.org/silverstripe/silverstripe-framework/builds/389503339 to confirm.

@tractorcow
Copy link
Contributor

tractorcow commented Jun 12, 2018

It looks like, somehow, this broke something? I can't see how though. Only postgres broke.

@tractorcow
Copy link
Contributor

Restarting this build. Maybe it was just an occasional error.

@dhensby
Copy link
Contributor

dhensby commented Jun 12, 2018

Green

@tractorcow tractorcow merged commit 1acb808 into silverstripe:3.7 Jun 13, 2018
@xini xini deleted the patch-4 branch June 13, 2018 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants