fix: incorrect created date shown on backup method#572
Open
gavynj wants to merge 5 commits intosilverstripe:5from
Open
fix: incorrect created date shown on backup method#572gavynj wants to merge 5 commits intosilverstripe:5from
gavynj wants to merge 5 commits intosilverstripe:5from
Conversation
Contributor
|
Nice finds! The changes look ok to me. I wonder whether we should require the member to be passed always and not fallback to the current user at all. You may also want to update the doc block when you add a method param and strongly type it to Member. |
Contributor
|
The lint failure is related. |
2 tasks
GuySartorelli
requested changes
Oct 23, 2024
GuySartorelli
requested changes
Jan 27, 2025
Comment on lines
51
to
55
| if (!$this->value && $this->getForm() && $this->getForm()->getRecord() instanceof Member) { | ||
| $member = $this->getForm()->getRecord(); | ||
| $this->member = $this->getForm()->getRecord(); | ||
| } else { | ||
| $member = DataObject::get_by_id(Member::class, $this->value); | ||
| $this->member = DataObject::get_by_id(Member::class, $this->value); | ||
| } |
Member
There was a problem hiding this comment.
Looking at this again, I think it would be better to convert this part into a private method that returns the member record, and can be called from both getSchemaDataDefaults() and getBackupMethod().
That way we never have to fall back on ?? Security::getCurrentUser() if getBackupMethod() is called first.
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.
This PR fixes issue #571
When viewing a member, at the bottom of their member screen on the backend it says whether they have MFA setup and when their recovery codes were created. However, for any user that has MFA setup, the recovery codes created date always shows as today.