Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong card number when opening template editor #3808

@jcznk

Description

@jcznk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions