ijgnd / anki21__editor_add_hyperlink

5 stars 7 forks source link

Name error #11

Closed GrimPixel closed 2 years ago

GrimPixel commented 2 years ago

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨Keep model of add cards⁩': ⁨Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/aqt/addons.py", line 239, in loadAddons import(addon.dir_name) File "/home/grim/.local/share/Anki2/addons21/424778276/init.py", line 6, in from . import addCards File "/home/grim/.local/share/Anki2/addons21/424778276/addCards.py", line 61, in AddCards.onResetSameModel = onResetSameModel NameError: name 'onResetSameModel' is not defined ⁩

ijgnd commented 2 years ago

tldr: delete the add-on "keep model of add cards", restart Anki. "add hyperlink" is not the problem.

when you read the error message you see the full path of the file where the error occurs. Ankiweb gives each add-on a unique id that you need for installing and that is also used as its folder. So in your case we know that it's the add-on "424778276":

File "/home/grim/.local/share/Anki2/addons21/424778276/addCards.py", line 61, in

So you can go to the addon21 folder, then go into 424778276 and check which add-on it is. Or you can check the source code of https://ankiweb.net/shared/addons/2.1 (in Firefox press Ctrl+u to view the source of a page) and then search for 424778276.

technical background: keep model of add cards should no longer be needed in Anki 2.1.45 because - as far as I see - of the commit Simplify note adding and the deck/notetype choosers that was released in 2.1.45.

If 2.1.45 or newer without "keep model of add cards" behaves wrongly please let me know because that would be relevant for this thread ...

GrimPixel commented 2 years ago

I'm sorry. I had a bunch of add-ons not working and had mistaken this as that.