mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
52 stars 7 forks source link

BUG: Error when selecting the "Tags" field in the settings #98

Closed BorisNA closed 8 months ago

BorisNA commented 8 months ago

Describe the bug Exception when clicking on the "tags" field in Settings.

To Reproduce Steps to reproduce the behavior:

  1. Open Settings
  2. Click on the "rags" field
  3. Get an exception

Caught exception:

Traceback (most recent call last):
  File "C:\_MyPrograms\Anki2\Data\addons21\472573498\settings_dialog.py", line 722, in _tags_cell_clicked
    note_type = mw.col.models.get(NotetypeId(int(current_model_id)))
  File "C:\_MyPrograms\Anki2\Data\addons21\472573498\tag_selection_dialog.py", line 71, in set_selected_tags_and_row
    excluded: list[str] = tag_object["exclude"]
TypeError: list indices must be integers or slices, not str

image

Desktop (please complete the following information): Anki 2.1.66 (70506aeb) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2

Platform: Windows-10-10.0.19045 Flags: frz=True ao=True sv=3 Add-ons, last update check: 2023-12-13 18:58:04 Add-ons possibly involved: ⁨ankimorphs-alpha⁩

Additional context My meta.json with the config is attached meta.json

mortii commented 8 months ago

@BorisNA Thanks for reporting it!

Your settings are outdated, you can fix it in three ways:

  1. delete meta.json
  2. Tools -> AnkiMorphs -> Settings -> Restore all default settings
  3. Tools -> Add-ons -> Select ankimorphs-alpha -> Config -> Restore Defaults

After that you have to redo the settings

BorisNA commented 8 months ago

Oh, my bad, should have thought about it. Anyway, after I edited meta.json for the "tags" key, I got a big message that I should update settings ... it looks like it was blocked by the exceptions mentioned above.

P.S. Sorry for hijacking the thread, I'm a littel bit lazy to open another issue. It looks like there should be "from . import ankimorphs_globals" and not "from ankimorphs import ankimorphs_globals" at config.py:13 . At least it throws another exception for me.

mortii commented 8 months ago

P.S. Sorry for hijacking the thread, I'm a littel bit lazy to open another issue. It looks like there should be "from . import ankimorphs_globals" and not "from ankimorphs import ankimorphs_globals" at config.py:13 . At least it throws another exception for me.

@BorisNA holy, I have no idea how that happened.... Thanks for letting me know! I pushed a hotfix, does everything work for you now?

BorisNA commented 8 months ago

Yes, it works perfectly. Thanks alot.

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.