Tag Toggler (Fork for 2.1) [Official thread]

If you have a problem with the add-on Tag Toggler (Fork for 2.1) post in this thread. This way I get notified. If you make a new thread I will likely miss it. If you post your comment, question or bug report on ankiweb as a review I won’t get notified. You really should post in this thread.

It seems that some part of this addon is conflicting with Arthur Milchior’s Directly review, without going through overview page addon.

It occurs once on clicking on a deck, and results in this error window.

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 section of our support site. 
Debug info:
Anki 2.1.40 (cf446733) 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-04-18 01:23:49

Caught exception:
Traceback (most recent call last):
  File "D:\Data Storage\AnkiData\addons21\1024346707\main.py", line 41, in onStudyDeck
  File "D:\Data Storage\AnkiData\addons21\1024346707\main.py", line 17, in onReview
  File "aqt\main.py", line 646, in moveToState
  File "aqt\main.py", line 668, in _reviewState
  File "aqt\reviewer.py", line 68, in show
  File "aqt\main.py", line 980, in setStateShortcuts
  File "anki\hooks.py", line 34, in runHook
  File "D:\Data Storage\AnkiData\addons21\1429363228\tag_toggler.py", line 59, in addShortcuts
    for k, v in mw.addonManager.getConfig(__name__).items():
AttributeError: 'NoneType' object has no attribute 'items'

On clicking the deck again, it works normally, but that error window is rather annoying as it increases clicks required to study, which is counter to the point of Arthur’s addon. If there exists an easy fix with either addon that I can implement myself, that would be great. I did submit an issue on Arthur’s GitHub around 6 months ago but it has no reply, so I thought I’d ask you.

1 Like

Apologies for the late response, I’d forgotten to check for replies.

I checked the config file, and there was invalid JSON in there, I deleted that and both addons work perfectly now :slight_smile:

Thank You!

Not relevant anymore, but here’s the issue I submitted on Arthur’s Github


I am trying to delete the default shortcuts provided this add-on in the add-on config page. When I add my custom shortcuts and delete the default shortcuts and click “OK”, and revisit the config page, I still see the default shortcuts (Although the custom shortcuts that I added is also present).

Is there a way to circumvent this issue?

anki doesn’t allow to delete the default config. I just uploaded a new version with an empty default config (instead of a version of the one I used for myself …) so that you can adjust it as you like. update the add-ons, restart anki, reset the add-on config to defaults and restart. then you should no longer have unwanted config entries.

I noticed that, if V3 scheduler is active, Ctrl+Z/undo/etc does not work anymore for this and other addons. E.g. if I use this addon to tag and suspend a card, then click Ctrl+Z, Anki says “nothing to undo”.

It might be due to this: 2021 scheduler - undo

@jcznk: Thanks for the info. Yes, my add-on breaks this. I’ve added a note to the add-on description. I’m not using the add-on at the moment and very few other people seem to use it so fixing this is (admittedly) a very low priority for me.