Skip to content

[NRT-34] Allow extra local fields#35

Merged
RisingOrange merged 4 commits intomasterfrom
allow-extra-local-fields
Mar 11, 2025
Merged

[NRT-34] Allow extra local fields#35
RisingOrange merged 4 commits intomasterfrom
allow-extra-local-fields

Conversation

@RisingOrange
Copy link
Collaborator

@RisingOrange RisingOrange commented Mar 11, 2025

Both, the AnkiHub add-on and the AnKing note types add-on, can update the fields of note types. We need to prevent issues where one add-on adds a field, and the other removes it, leading to loss of note fields contents for that field.

We can do this by changing the add-ons so that they only add fields, but don’t remove them.
The add-ons should just add missing fields and ignore extra fields.
This will also have the effect that users will be able to add extra fields to the note type, without the fields getting reset during sync.

AnkiHub add-on PR: AnkiHubSoftware/ankihub_addon#1117

Related issues

https://ankihub.atlassian.net/jira/software/c/projects/NRT/boards/41?selectedIssue=NRT-34

Resetting note type with extra fields

  • Add a field to an AnKing note type (in Anki)
  • Reset the note type using AnKing -> AnKing Note Types -> Go to the tab of the note type -> Reset -> Confirm
  • Check that the field was not removed

You can also try removing a field which is on the note type (not only locally) and see that it gets added.
Additionally, you can position an extra local field after the ankihub_id field of an AnkiHub version of an AnKing note type, then reset. The new local extra field should be moved before the ankihub_id field.

@RisingOrange RisingOrange requested a review from abdnh March 11, 2025 12:36
@RisingOrange RisingOrange merged commit a983fc0 into master Mar 11, 2025
1 check passed
@RisingOrange RisingOrange deleted the allow-extra-local-fields branch March 11, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants