ssricardo / anki-plugins

Contains a set of addons for the open source application Anki Desktop
95 stars 20 forks source link

not compatible with "Multiple type fields for card 2.1" add on #115

Closed michelleenos closed 1 year ago

michelleenos commented 2 years ago

I'm also using this add-on that lets you have multiple type fields on one card: https://ankiweb.net/shared/info/711285688

This add-on is great but I would like to be able to use both - any suggestions/advice welcome!

With both add-ons enabled, Anki crashes. Here is the error code from that add-on:

Error
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, repeating 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 to the add-on author.
Debug info:
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Mac 12.4
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-07-15 23:40:23
Add-ons possibly involved: ⁨Multiple type fields on card for 21⁩

Caught exception:
Traceback (most recent call last):
  File "aqt.webview", line 568, in handler
  File "/Users/michelleenos/Library/Application Support/Anki2/addons21/711285688/Multiple_type_fields_on_card_for_2_1.py", line 135, in myOnTypedAnswer
    self._showAnswer()
  File "aqt.reviewer", line 402, in _showAnswer
  File "aqt.reviewer", line 332, in _mungeQA
  File "/Users/michelleenos/Library/Application Support/Anki2/addons21/711285688/Multiple_type_fields_on_card_for_2_1.py", line 43, in myTypeAnsFilter
    return self.typeAnsAnswerFilter(buf, 0)
TypeError: typeAnsAnswerFilter() takes 2 positional arguments but 3 were given
michelleenos commented 2 years ago

It does seem like this plugin author is aware of this but doesn't have the capacity to make a fix, so there may not be much that can be done in terms of this plugin. Here's the issue: https://github.com/r0uv3n/Multiple-type-fields-on-Card-for-Anki-2.1/issues/4 feel free to close this issue if that is the case!

ssricardo commented 2 years ago

I'll leave it open for now, to take a look in the future (when I have time). But in advance, it's really hard maintain the add-on, if we start changing it to adapt to other add-on (which can change anytime).

So it's unlikely, but still I'll give it a try when possible

r0uv3n commented 2 years ago

Hi, (not very active) maintainer of the other add on here.

Yeah, right now (or when I adapted the Add On for Anki 2.1) the Reviewer (within the Anki source) is in a state where adding functionality often seems to require monkey patching (or requesting tons of hooks to be added). If my memory serves me right, a rework of the Reviewer is planned (which will probably require a rewrite of all these Add Ons anyway), and maybe then we can rewrite them in a cleaner way to avoid incompatibilities.

ssricardo commented 2 years ago

Hey Henry @r0uv3n! Thanks for the info. I think I also saw sth that the reviewer will be changed. Yeah, we need to wait, before that it's quite hard to have combability between the addons.

I plan to allow a distinct prefix (instead of default type:) for my add-on. If I have time I'll try doing it in November (now in October - no way...)

EugeneTarasenko commented 1 year ago

I am having the same problem. Would be extremely grateful for a fix.

ssricardo commented 1 year ago

Please check whether this is already solve with the new version: version 2.7 (10.01.2023)

ssricardo commented 1 year ago

Closing as it seems to be fixed in the last release