Fixes DOB & customer account save validations#5146
Merged
Conversation
- NotBlank check is optional for Date & DateTime now
- validate password only when user changes the password - updated NotBlank check for DOB
- fixes DOB validation, customer uses Date format, but create order uses DateTime format - updated NotBlank check
Hanmac
previously approved these changes
Dec 11, 2025
- see account register (cypress test)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes validation issues related to Date of Birth (DOB) and customer account password validation. The main changes address: (1) incorrect DOB validation that didn't properly handle required/optional states, (2) password validation being triggered unnecessarily when passwords weren't being changed, and (3) proper handling of datetime values in date validation.
Key Changes:
- Enhanced DOB validation to properly support optional, required, and no validation states by adding
emptyandemptyMessageparameters to date/datetime validators - Added password change detection via
isChangePasswordflag to prevent password validation when only other customer data is being updated - Fixed date validation to automatically handle datetime values when a time component is present
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/code/core/Mage/Core/Helper/Validate.php | Added empty and emptyMessage parameters to validateDate and validateDateTime methods to control NotBlank constraint application |
| app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php | Updated date/datetime validation to pass empty parameter based on attribute's required state and added automatic datetime detection |
| app/code/core/Mage/Customer/Model/Customer.php | Modified validate() to check isChangePassword flag before validating passwords, updated DOB validation to use new empty parameter, added missing exception docblocks |
| app/code/core/Mage/Customer/Model/Form.php | Added @method docblock for getSystemAttributes() return type |
| app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php | Removed redundant inline type hint comment (now covered by Form.php docblock) |
| tests/unit/Traits/DataProvider/Mage/Customer/CustomerTrait.php | Added getIsChangePassword to test data provider |
| cypress/e2e/openmage/frontend/customer/account.cy.js | Fixed test name from "invalid" to "valid" form submission |
| cypress/e2e/openmage/backend/customer/customer.cy.js | Added test for saving existing customer to verify validation fix |
|
Hanmac
approved these changes
Dec 12, 2025
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.



Description (*)
Bugfixes.
Related Pull Requests
Zend_Validatewithsymfony/validator#4612Fixed Issues (if relevant)