-
Notifications
You must be signed in to change notification settings - Fork 824
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
Controller::curr() should return null instead of throwing an exception #11386
Comments
This was referenced Feb 13, 2025
@emteknetnz NEeds a CMS 6 changelog entry - lots of people will have if (Controller::has_curr()) {
$controller = Controller::curr();
// do something with controller
} and they'll need to change that now to something like $controller = Controller::curr();
if ($controller) {
// do something with controller
} |
Updated |
PRs merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Controller::curr()
currently throws an exception if there's no current controller. This means you have to useController::has_curr()
any time you want to callcurr()
- when anull
return value would do just as well.Related issues
Acceptance Criteria
Controller::curr()
returnsnull
if there's no current controller (instead of throwing an exception).Controller::has_curr()
should be removed or notCMS 5 PRs
After merging assign back to Steve to merge-up and rebase
CMS 6 kitchen sink CI
CMS 6 PRs
The text was updated successfully, but these errors were encountered: