Fix: Resetting forgotten password#3732
Open
Vondry wants to merge 2 commits into
Open
Conversation
config->get() returns a DeepCollection, not an array. With strict_types enabled this caused a TypeError on the array type hint. Accept DeepCollection, which supports ArrayAccess for the key lookups used.
7624a99 to
9edebaf
Compare
- Add MAILER_DSN environment variable to phpunit.xml.dist for test environment - Add defensive handling in Canonical.php for malformed URLs in test environment - Add comprehensive test coverage for ResetPasswordController
9edebaf to
2a53d3e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Requesting a password reset at
/bolt/reset-passwordreturned HTTP 500 with aTypeError:buildResetEmail()declared anarray $configparameter, butconfig->get('general/reset_password_settings')returns aBolt\Collection\DeepCollection. Understrict_types=1PHP refuses the object→array coercion.Fix
1. Primary fix
Fixed by changing the parameter type hint to
DeepCollection, which extends Laravel'sCollectionand implementsArrayAccess, so the existing$config['mail_from']lookups still work unchanged.2. Test Environment Configuration
MAILER_DSN=null://nulltophpunit.xml.distto prevent mailer configuration errors during tests.src/Canonical.phpto safely handle malformed URLs and incompleteparse_url()results.3. Test Coverage
Added
ResetPasswordControllerTest.phpto verify that:The password reset page loads successfully
The reset form renders correctly
Requests are handled without triggering
TypeErrorexceptionsTesting
Screen.Recording.2026-06-04.at.15.03.04.mov