Arthur-Milchior / anki-enhanced-cloze

GNU General Public License v3.0
2 stars 1 forks source link

Incompatible with Anki 2.1.20 beta #18

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello Card shows the following error when trying to view it. Card template has a problem: found '{{c2::abc}}', but there is no field called 'abc' Should be related to the updates to card template rendering

ijgnd commented 4 years ago

you must edit your front template, change all occurences of {{c2::abc}} to { {c2::abc} }. This has no effect since {{c2::abc}} was just in a comment in a javascript function.

I mean these lines: https://github.com/ijgnd/anki-enhanced-cloze/blob/master/src/Enhanced_Cloze_Front_Side.html#L122

Apart from this it mainly seems to work with 2.1.20. But I wouldn't make new notes with this add-on because there's no maintainer.

ghost commented 4 years ago

Thanks for your help. You mean Arthur isn't maintaining this anymore? That sucks since the only alternative Cloze (Hide-All) also partially broke with the latest update.

ijgnd commented 4 years ago

"Enhanced Cloze" is no longer on ankiweb.

about "Cloze Hide All":

Your report looks similar to a problem I had.

I haven't looked into this problem but the first change I made seems to have removed the similar problem. So before I learn the details of the new Anki code maybe you could change one line and tell me if it changes something

Change https://github.com/phu54321/anki_plugins/blob/master/cloze_hide_all/cloze_hide_all_21.py#L220 from

addHook("profileLoaded", registerClozeModel)

to

# addHook("profileLoaded", registerClozeModel)
from aqt import gui_hooks
gui_hooks.profile_did_open.append(registerClozeModel)

and restart Anki 2.1.20beta6. The new code only works in 2.1.20. For 2.1.19 you would have to revert it.

ghost commented 4 years ago

I got a new report upon rebooting Debug info: Anki 2.1.20 (23f13a31) Python 3.8.0 Qt 5.14.0 PyQt 5.13.2 Platform: Windows 10 Flags: frz=True ao=True sv=2

Caught exception: Traceback (most recent call last): File "aqt\progress.py", line 73, in handler File "C:\Users\John Smith\AppData\Roaming\Anki2\addons21\1709973686\cloze_hide_all_21.py", line 419, in newCallback callback() File "C:\Users\John Smith\AppData\Roaming\Anki2\addons21\2062736101__init.py", line 222, in newCallback callback() File "aqt\browser.py", line 814, in File "aqt\browser.py", line 833, in _onRowChanged File "aqt\gui_hooks.py", line 174, in call__ File "lib\site-packages\anki\hooks.py", line 451, in runHook File "C:\Users\John Smith\AppData\Roaming\Anki2\addons21\2140680811\infobar.py", line 126, in updateInfoBar updateInfoBar_default(self) File "C:\Users\John Smith\AppData\Roaming\Anki2\addons21\2140680811\infobar.py", line 147, in updateInfoBar_default p = self.cardstats(self.card) File "C:\Users\John Smith\AppData\Roaming\Anki2\addons21\2140680811\card_properties.py", line 51, in cardstats o["Due"] = due_day(card) File "C:\Users\John Smith\AppData\Roaming\Anki2\addons21\2140680811\helper.py", line 24, in due_day return time.strftime("%Y-%m-%d", time.localtime(mydue)) OSError: [Errno 22] Invalid argument

Disabling Browser Card Info Bar seems to fix it.

ijgnd commented 4 years ago