Field History add-on not working with recent versions


Back in September 2019, Glutanimate released an add-on that I really liked: Field History. Here’s a link to it on AnkiWeb. This add-on improves Anki’s Add Notes dialog with hotkeys that allow you to copy over fields from the previous note in the same deck, and bring up a searchable history window of previous values for a field.

However, the add-on has not worked with recent versions of Anki. I have tried contacting Glutanimate about fixing it, but no reply.

Would anyone be able to help?

Here’s the error message that comes up.

An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem. 
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons sectionof our support site. 
Debug info:
Anki 2.1.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-11-06 08:18:56

Caught exception:
Traceback (most recent call last):
File "aqt\", line 317, in checkFocus
File "C:\Users\Harry's laptop\AppData\Roaming\Anki2\addons21\1247884413\", line 212, in <lambda>
lambda: editor.restoreEditorFields("history")),
File "C:\Users\Harry's laptop\AppData\Roaming\Anki2\addons21\1247884413\", line 172, in restoreEditorFields
ret = historyRestore(self, mode, results, model, fld)
File "C:\Users\Harry's laptop\AppData\Roaming\Anki2\addons21\1247884413\", line 109, in historyRestore
(text, ret) = myGetField(self.parentWindow,
File "C:\Users\Harry's laptop\AppData\Roaming\Anki2\addons21\1247884413\", line 80, in myGetField
edit = CustomTextEdit(parent, last_val)
File "C:\Users\Harry's laptop\AppData\Roaming\Anki2\addons21\1247884413\", line 62, in __init__
AttributeError: 'builtin_function_or_method' object has no attribute 'setCompletionMode'

Best wishes,

This particular error is actually fixed in the development repository of the add-on. I updated the config.json and files according to config.schema.json and uploaded the changed files here.

Just replace those files in the add-on folder.

I can’t guarantee this will work on the latest versions, as I’ve not tested it much.

Working on ⁨2.1.49! I love this add-on, thank you so much :slight_smile:

I wonder if it would be worth publishing this on AnkiWeb? Doesn’t make sense for it to be fixed but so hard to find?

You can publish it if you like, maybe until Glutanimate updates his version, with a note that it’s not the official version.