[Two bugs] Cards not generated when {{field}} inside {{#CardType}}?

Anki Version ⁨23.10 (51a10f09)⁩
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: Windows 11

I just ported over my main deck over from Anki1 and ran into the problem that Cards were not being automatically generated from my (many-field) Note templates when I created a new Note.

The Cards appear blank in the Card Editor and are not generated, but the preview fills in when the “Fill Empty Fields” box is checked:

  1. Cards coded to contain field {{명사}} are blank, despite the “명사” field being specified in the Note editor:

  1. The same Card fills (but only in the preview window) when the “Fill Empty Fields” is checked:

At first I thought that this was a problem with my non-latin field names, and changing the field names appeared to fix the problem, generating a bunch of Cards for each Note, but further inspection revealed that this was only because the “Field Rename” button appended {{field1}} to the end of (all) the Front card templates:

That looks like a second bug.

Deleting the automatically-generated tags {{#CardType}} and {{/CardType}} in each Card template seems to fix the problem with Card generation:

It also resolves the problem with the field rename function appending the first field to the end of each Front card template.

So it looks like there are two related bugs here:

  1. The Anki1 deck importer in Anki2.0.52 adds the tags {{#CardType}} and {{/CardType}} around each Front Card, but Anki 23.10 doesn’t recognize fields within these tags.

  2. The “Field Rename” in Anki 23.10 successfully renames each field, but it also appends the first field in the Note type to the end of each Front card template if {{#CardType}} and {{/CardType}} are in the Note template.

As an aside, I now have ~25,000 new Cards with no Front text. These cards were not generated in Anki1, but now they are automatically generated. (I think this was the issue which convinced me not to port over to Anki2.0 ten years ago). What is the best way to delete/suppress these?

Anki has not supported the former for a number of years - you can use {{#c1}} instead to match the first card template. For the latter, I can’t easily reproduce this, as Anki won’t let save a card template that references an invalid field. If after correcting the former issue, you can still reproduce the latter, could you please provide minimum steps to reproduce?

If you have other templates in that note, c1 or equivalent should resolve that. If the notes have no other templates, Anki adds at least one card because otherwise you wouldn’t be able to access the notes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.