Template overrides are not mentioned in the error message when they reference a non-existent field

Anki 2.1.54 shows:

Front template has a problem:
Found '<U+2068>{{#cde}}<U+2069>', but there is no field called '<U+2068>cde<U+2069>'
More information

The field is referenced in “Override front template” in “Options” → “Browser Appearance”.

It is also impossible to see what the problematic note type is when the error appears in the browser, impossible to add tags or whatever.

Also, the issue I had described but deleted the message was that you can’t fix only a part of the template: Anki won’t let you save it.

This error simply states that you are trying to use a field that does not exist, in your case, cde. Are you sure this field exists (and the name is exactly cde, case-sensitive)?

Besides, I don’t know if that’s related, but it’s a bit strange that if it finds <U+2068>{{#cde}}<U+2069> it complains about not finding <U+2068>cde<U+2069> (I would have expected it would complain about not finding cde), however since <U+2068> and <U+2069> tags are special tags that do not represent text, but only modify the direction in which is it show (ie. right-to-left or left-to-right), maybe that’s what breaks Anki: it doesn’t consider them as text, so it includes them so it will be shown correctly, but that prevents it from finding a field that contains them in the name. If you try disabling any right-to-left option you may have activated (ie. writing text plainly left-to-right), does it work?

Are you replying to the latest version of my post, or to the original one?

The original one.

I don’t think the control characters matter. Looks as if they’re added by fluent.

I understand your confusion, @Aleksej. Anki should mention if the issue is with a browser template. Also in the card list, we shouldn’t disable the row, but instead put the error message in the question column only.
However, allowing to fix only part of a notetype isn’t practical. But maybe this doesn’t matter too much, if Anki indicates the faulty template less ambiguously in the future.

2 Likes

Indeed, when I first stumbled into this kind of issues, I found it frustrating that Anki only allows you to have “valid” notetypes, which means that you have to start by fixing “by the good end” otherwise Anki will not save the changes, so you have to start over.

However, I got used to it quite quickly and maybe this drawback is worth the immediate feedback a user gets when they have a broken note type.

2 Likes

Yeah, it can cause some inconvenience for experienced users, but hopefully, the amount of faulty templates it prevents from getting created or shared outweighs this by far.