Error on modified Image Occlusion note type

Error message: “:warning: Cloze deletion can only be used in fields which use the ‘cloze:’ filter. This is typically the first field.”

Hello :wave:.

TLDR: Cloned Image Occlusion note type breaks after ‘Check Database’ if the ‘Occlusion’ field is no longer the first field. Video link: https://youtu.be/SdkqyW3DUaE

I spent so many hours trying to figure out what was going wrong with my custom Image Occlusion note type (I cloned the built-in Image Occlusion field, added an ID field and repositioned it to make it the first field).

The cards work perfectly fine until I run “Check database”. At this point it seems Anki “resets” the notetype and assumes that the first field is the Occlusion field so I start getting the error above when I try to add more shapes to the Occlusion.

The notes still work using the initial Occlusion data but no further changes can be made to the notes’ Occlusions unless I reposition the Occlusion field and make it the first field.

It would be great for me for the notetype to work with my own custom note field so that I can update or skip existing notes the next time I use a csv import. I understand Anki uses the first field to check such things during an import.

Please take a look at the video (https://youtu.be/SdkqyW3DUaE) where I reproduce the error starting with a blank profile. Some guidance on what I could be doing wrong or a fix in the next update would be greatly appreciated!

Edit: Almost forgot. I’m using:
Version ⁨23.12.1 (1a1d4d54)⁩
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1

on Windows; Beta version 24.04 has the same issue.

Anki Anna Image Occlusion fields list
Screenshot 2024-03-24 180031

Regards,

The I/O notetype was originally order-dependent, and IIRC, check database changes it so that fields can be reordered (which is now the default). So I think you’d need to make the changes to it after checking the database, not before.

Thanks, Damien. That makes sense. You’re probably right.

Thing is I need to use “Check Database” frequently to reset tags and I don’t want to lose any information in the process.

Your advice gave me an idea, maybe that’s what you had in mind actually: to reposition my new ID column to the last position, run check database, then move it back to position 1 where I need it. This seems to be working perfectly if the notetype wasn’t broken already. Position 2 doesn’t work because then Anki doesn’t know where the image is so I’m using the last position (6).

It seems if the notetype is broken already then this might not fully restore it but at least I’m able to make changes to the Occlusion before I move the ID column back to position 1.

It would be great if “Check Database” didn’t “break” the custom notetypes though. Is there any chance you will get time to look at changing that behaviour?

Yes, this is what I meant. Glad to hear it worked. It is necessary to run Check Database at least once to upgrade your version from an older Anki. After that, modifications should work.

1 Like