Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong card number when opening template editor #3808

Open
jcznk opened this issue Feb 11, 2025 · 0 comments · May be fixed by #3814
Open

Wrong card number when opening template editor #3808

jcznk opened this issue Feb 11, 2025 · 0 comments · May be fixed by #3814

Comments

@jcznk
Copy link

jcznk commented Feb 11, 2025

I am testing on Anki 25.02 for Windows. Also experienced the behavior on previous versions.

Steps to reproduce:

  1. Load a card in the Reviewer.
  2. Open the Editor (press E or click Edit).
  3. Without closing the Editor, return to the Reviewer.
  4. Continue reviewing cards.
  5. Bring up the Editor again → it correctly updates to show the new card.
  6. Open the Card Layout Editor (Ctrl+L or Cards...).

→ Expected behavior: the Template Editor should load the card type corresponding to the card you "re-opened" the Editor for (e.g., card type 2).
→ Actual Behavior: the Template Editor instead loads the card type corresponding to the first card the Editor was opened for (e.g., card type 4). If the current note type doesn't have that card type number, the Template Editor throws an error and refuses to open.

Traceback (most recent call last):
  File "aqt.webview", line 667, in handler
  File "aqt.editor", line 647, in <lambda>
  File "aqt.editor", line 381, in _onCardLayout
  File "aqt.clayout", line 91, in __init__
  File "aqt.clayout", line 104, in redraw_everything
  File "aqt.clayout", line 111, in update_current_ordinal_and_redraw
  File "aqt.clayout", line 486, in fill_fields_from_template
  File "aqt.clayout", line 483, in current_template
IndexError: list index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant