I’m having the exact same problem now. Last update was a month ago, went smoothly - I haven’t added anything new since. This is the deck in question : Raagaception's 12STD CBSE Deck (Science stream, PCM) - AnkiWeb
Deleted all Note types except my custom Basic and Cloze note types. Checked database, deleted unused media. Any idea on what might have gone wrong?
EDIT : the update I’m trying to do involves modifying the tags, I haven’t added any new cards. Is having new cards in the update compulsory?
dae
July 26, 2021, 9:33am
2
Your notetype is referencing a field that doesn’t exist, so you should remove the following lines:
{{#FrontOpt}}
<div class="frontopt">{{FrontOpt}}</div>
{{/FrontOpt}}
@Rumo when wrapped in a conditional, no warning appears, so it looks as if the card is fine when it’s not. Perhaps we could could do something like the following?
diff --git a/rslib/src/template.rs b/rslib/src/template.rs
index 1bde79f3d..d067b8798 100644
--- a/rslib/src/template.rs
+++ b/rslib/src/template.rs
@@ -469,6 +469,12 @@ fn render_into(
Conditional { key, children } => {
if context.nonempty_fields.contains(key.as_str()) {
render_into(rendered_nodes, children.as_ref(), context, tr)?;
+ } else if !context.fields.contains_key(key.as_str()) && !card_ordinal_reference(key)
+ {
+ return Err(TemplateError::ConditionalNotFound {
+ field: key.to_string(),
+ prefix: "#",
+ });
}
}
NegatedConditional { key, children } => {
We’d need to exclude references like {{#c3}}
Rumo
July 26, 2021, 11:12am
3
I haven’t worked directly with this code, but it sounds reasonable.
Oh damn, my bad. Thanks for the heads up!
I’ll make the note type correction for a major deck update (when I make it after a few exams) and let you know if it worked - can’t update casually right now as it might confuse the deck users.