AnKing-VIP / anki-bionic-reading

Bionic Reading add-on for Anki
GNU Affero General Public License v3.0
0 stars 0 forks source link

Bionic not applying to ticked cardtypes, "Toggle All Notetypes" doesn't seem to work either. #6

Closed natnina closed 7 months ago

natnina commented 10 months ago

Problem description

Please describe the issue concisely in here. In case of an error: Walk us through the steps you took to get there. What happened? What did you expect to happen?

Problem 1: The "Toggle All Notetypes" doesn't seem to do anything/doesn't toggle all notetypes. Problem 2: The Bionic reading doesn't seem to be applying to all the cards that I ticked with a checkmark. I tried just with "Cloze" cards but it didn't apply. I've restarted Anki a few times after downloading, after receiving the error (pasted below), and after I reclicked note types "on". Problem 3: After restarting, the ticked notetypes "unclicks".

Checklist

Please replace the space inside the brackets with an x if the following items apply:

What Anki version are you using?

*Please open Anki, go to Help → About (windows) or Anki → About Anki (mac) to find the version. Edit the value between the backticks below

2.1.65

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

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.65 (aa9a734f) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-12.7-x86_64-i386-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-12 11:41:49
Add-ons possibly involved: ⁨Bionic Reading⁩

Traceback (most recent call last):
  File "aqt.main", line 607, in loadCollection
  File "_aqt.hooks", line 1497, in __call__
  File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/main.py", line 39, in on_anki_start
    check_update()
  File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/firstrun.py", line 77, in check_update
    on_update(prev_version, curr_version)
  File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/firstrun.py", line 68, in on_update
    add_script_to_all_note_types()
  File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/notetype.py", line 54, in add_script_to_all_note_types
    mw.col.models.update_dict(note_type)
  File "anki.models", line 223, in update_dict
  File "anki._backend_generated", line 862, in update_notetype_legacy
  File "anki._backend", line 156, in _run_command
anki.errors.CardTypeError: Card template ⁨3⁩ in notetype '⁨A. Artery⁩' has a problem.<br>Expected to find a field replacement on the front of the card template.
FancyGhosty commented 10 months ago

I am having the same issue.

BlueGreenMagick commented 10 months ago

I think your note type may already be invalid. Maybe it didn't throw an error in an older Anki version, but now it does. Can you try opening the note type template in Anki Note types and see if it saves alright?

natnina commented 9 months ago

I think your note type may already be invalid. Maybe it didn't throw an error in an older Anki version, but now it does. Can you try opening the note type template in Anki Note types and see if it saves alright?

I don't understand... would you elaborate or write a step by step of what you'd like me to try, please?

AnKingMed commented 9 months ago

@BlueGreenMagick are you ok to troubleshoot this? I'm not quite sure what you thought was going on

BlueGreenMagick commented 9 months ago
  1. In toolbar, go to ' Tools > Manage Note Types '.
  2. Select 'A. Artery' notetype and click 'Cards...' button.
  3. In the card type editor, change 'Card Type' to the 3rd template.
  4. In Front template, you need to add a field replacement. (e.g. {{Front}})
natnina commented 9 months ago

Screen Shot 2024-01-01 at 6 25 26 PM

New problem in the preview window "couldn't find Front" so I changed to {{Text}} and same message.

BlueGreenMagick commented 9 months ago

That's because your note type doesn't have the field 'Front'.

I think you accidentally added a new Card template and what you want to do is to delete it. Click the 'Options...' button on the right side of the 'Card Type' bar and click 'Remove Card Type...'

natnina commented 9 months ago

That's because your note type doesn't have the field 'Front'.

I think you accidentally added a new Card template and what you want to do is to delete it. Click the 'Options...' button on the right side of the 'Card Type' bar and click 'Remove Card Type...'

I didn't add any new Card Templates I only use what is included in the deck download. I don't feel comfortable deleting this card template since there are 269 notes that use it (screenshot below).

Following your instructions, I clicked the third (I think template) option in Card Type (you can see that on the previous screenshot)... so if not {{front}}, what would I add?

@BlueGreenMagick are you ok to troubleshoot this? I'm not quite sure what you thought was going on

I'm not sure what you thought was going on either. Would you elaborate on the full scope, please?

image

AnKingMed commented 9 months ago

None of your fields in that picture are "Front". You have "Artery" "Source" etc. THat's probably why. You need to add one of those field names and not {{Front}}

natnina commented 9 months ago

Got it - it worked for that A.Artery note type. I copied and pasted what was on Card Type template 1 to the dropdown template 3. I ticked Anking Overhaul (Anking/AnkingMed) notetypes and it works too. Thank you! However, other notetypes do not remain ticked after reopening Anki. Nor shows bionic reading even though it shows the field.

example: These were manually ticked before closing (the Toggle All Notetype button still doesn't work): Screen Shot 2024-01-03 at 4 48 46 PM

This is the only one that remained when reopening anki: Screen Shot 2024-01-03 at 5 13 16 PM

I checked the notetype of AnkiDerm specifically. It seems to have the cloze deletion for the field already on there. How should I proceed?? I'm super new to this so please excuse my limited knowledge on this. image

BlueGreenMagick commented 9 months ago

Did you click save after changing add-on config(toggling notetypes)?

natnina commented 8 months ago

Yup!

BlueGreenMagick commented 8 months ago

Hmm... might be because those are AnkiHub notetypes. AnkiHub add-on may be syncing the notetypes on startup so the edits to notetypes by bionic reading are being reverted. @AnKingMed may know more.

AnKingMed commented 8 months ago

@BlueGreenMagick that doesn't make sense because even the AnKingOverhaul note type that isn't an AnkiHub note type is getting unchecked and the AnkiHub one is staying? (but only one of the AnkiHub note types..)

@natnina I've noticed 2.1.65-66 has lots of weird bugs. Can you try 2.1.64 or 23.10? Also, does this still occur if Bionic Reading is the only addon toggled to be enabled and all others are disabled?

natnina commented 8 months ago

@AnKingMed Since my first post about this in November, I've updated to 23.10, and the issue persists. I think I've been on 23.10 for a few weeks now. image

updated Yes. I just disabled all my add-ons except for Bionic Reading. Restarted. Opened BIonic Reading and ticked the 3 Anking notetypes. I noticed it's after I press "Sync" that all the toggles are being removed except those top 4 ("AnkingOverhaul (Anking/Ankingmed) toggle removed too"!) So after each Sync or Restart, I have to reopen Bionic Reading and manually tick Anking notetypes again.

I manually ticked ALL the boxes to see what happens and only these are unticking after sync. (My main concern is the Anking Notetypes unticking since I use those everyday).

Screen Shot 2024-01-05 at 11 59 37 AM

I manually ticked all the boxes and pressed saved. Did not press Sync. I reoped Bionicreading Config and all remained ticked. As I detick each box, some show an error message pop up (similar to my initial post). I reticked and unticked to see which ones would reshow the error. The unticked boxes are the problem boxes below. Seems like I have 6 "problem Notetypes" remaining. Thankfully, Anking Notetypes are not among them. I pressed save. I did not Sync.

ERROR when Unclicking

I manually unticked all the boxes and saved. Then reopened bionic reading config and ticked the boxes that had showed errors boxes when unticking (opposite of above photo). No error messages popped up. Then when I press the Toggle All Notetypes, it works! All boxes tick to checked. I guess it doesn't work if there's an "error notetype" that has to be toggled among them. I saved. I synced. When I reopened, the following were unticked, and these aren't the problem boxes lol. unticked why

I untick everything, save, sync. I ticked all the non-error boxes. save. sync. Now it doesn't change - yay. Save. Sync. Anking cards are showing the bionic reading now. Everything seems to be working. Sync. Quit.

So like @BlueGreenMagick helped me before, it looks like I have 6 more Notetypes to "fix" or keep unticked. It's weird that finding those error message only happened when they had been ticked, saved, reopened, and then unticking each box to see which specific one would show an error.

Ps. I think a "Toggle Off All Notetypes" should be a button added. When some are toggled off. And the rest of the list is on, I can't untick the rest of the list.

Restarted Anki. and this error popped up:


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 23.10.1 (fac9e0ee) Python 3.9.15 Qt 5.14.2 PyQt 5.14.1 Platform: macOS-12.7.2-x86_64-i386-64bit Flags: frz=True ao=True sv=3 Add-ons, last update check: 2024-01-04 20:36:27 Add-ons possibly involved: ⁨Bionic Reading⁩

Traceback (most recent call last): File "aqt.main", line 629, in loadCollection File "_aqt.hooks", line 1593, in call File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/main.py", line 39, in on_anki_start check_update() File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/firstrun.py", line 77, in check_update on_update(prev_version, curr_version) File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/firstrun.py", line 68, in on_update add_script_to_all_note_types() File "/Users/natashac.k./Library/Application Support/Anki2/addons21/649714433/notetype.py", line 54, in add_script_to_all_note_types mw.col.models.update_dict(note_type) File "anki.models", line 226, in update_dict File "anki._backend_generated", line 1065, in update_notetype_legacy File "anki._backend", line 158, in _run_command anki.errors.CardTypeError: Card template ⁨3⁩ in notetype '⁨A. Bone, Joints, Ligaments, Fascia, Viscera⁩' has a problem.
Expected to find a field replacement on the front of the card template.


I open the bionic reading config and the notetype "A. Bone, Joints, Ligaments..." isn't even ticked on. I tick it on. I tick off. Save. Sync. I reopen the config window and the problem notetypes are still all unticked. Quit Anki. And same Error on restart. But the box isn't even ticked on!

I unticked everything again. save. sync. quit. Same error message on startup. I Quit Anki. I reopen, and only the 4 first boxes are ticked. I ticked Anking boxes. Save. Sync. Only first 4 boxes ticked. Anking boxes are unticked. I untick everything. save. sync. save sync. Restart.

I try only ticking Anking boxes again but the same problem from way above. So all or nothing it looks like. I would think that if certain boxes are unticked, it shouldn't throw an error.

So I fixed each of the problem note cards by copying the template 1 into template 3 but with a space above on template 3 otherwise a new error pops up that template 3 is exactly the same as template 1. I don't understand what the different templates are for but that's not today's problem to deal with - feel free to comment if you know!

Save. Sync. Quit. Reopen Anki. Open Bionic Reading Config. Everything is unticked. Toggle All Notetypes works! Save. Sync. Reopen the Config and everything is still ticked. Cards are showing Bionic. Turned on the Add-ons I previously had on. Everything is working! Quit.

Reopen. And still working! No Error message! Yay!

I hope that helps you, @FancyGhosty! TLDR: try fixing the notetypes like @BlueGreenMagick suggested but for each notetype that throws an error. At the bottom of the error message, it says which notetype is the culprit. I finally caught on.

Thank you @AnKingMed & @BlueGreenMagick for your patience and help.