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 Don't pass null as LeftAndMain error message. #1335

Merged

Conversation

GuySartorelli
Copy link
Member

Fixes https://github.com/silverstripe/silverstripe-security-extensions/runs/7602515088?check_suite_focus=true

SilverStripe\SecurityExtensions\Tests\Control\SudoModeControllerTest::testActivateFailsWithGetRequest
TypeError: SilverStripe\Admin\LeftAndMain::setHttpErrorMessage(): Argument #1 ($message) must be of type string, null given, called in /home/runner/work/silverstripe-security-extensions/silverstripe-security-extensions/vendor/silverstripe/admin/code/AdminErrorExtension.php on line 21

We shouldn't be trying to pass null where we've declared it should be a string.
We have to accept null into this hook anyway as sometimes that's actually passed in - so it still makes sense for that to be the default here. But we shouldn't pass it through.

@GuySartorelli
Copy link
Member Author

Failing behat tests are unrelated - fixed in #1336

@emteknetnz emteknetnz merged commit a441d91 into silverstripe:1 Aug 1, 2022
@emteknetnz emteknetnz deleted the pulls/1/no-null-error-message branch August 1, 2022 01:47
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.

2 participants