Anki-Android
Anki-Android copied to clipboard
Fix saving changes in NoteEditor after CardTemplateEditor visit
Purpose / Description
After going to CardTemplateEditor the current card being edited is fetched again from the collection(this makes the card to have a null Note). After making changes and attempting to save, in the saveNote() method the card's note is being accessed and because it's null a call to note(collection) is done. This call fetches the previous stored fields values and those values end up being saved instead of the changed ones.
Fixes
- Fixes #17282
How Has This Been Tested?
Ran the tests, manually verified the bug behavior. Also verified the normal save.
Checklist
- [x] You have a descriptive commit message with a short title (first line, max 50 chars).
- [x] You have commented your code, particularly in hard-to-understand areas
- [x] You have performed a self-review of your own code
- [ ] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner