From 0e046144a3a6281bf3edb7dc277b02838694981f Mon Sep 17 00:00:00 2001 From: David Allison <62114487+david-allison@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:52:46 +0000 Subject: [PATCH] fix: currentDeckId broken In a58b4c10ed2f1db7dab9a3b7244cbf957b6915c7, `currentDeckId` was updated to use a Kotlin-based builder, but `[this.]did` was coming from `DeckIdKt.Dsl` rather than from `[this@Card.]did` Cause 17591 Fixes 16704 (Note Editor issues) --- AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt index 99f47221f413..07d342b4f3be 100644 --- a/AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt +++ b/AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt @@ -20,9 +20,9 @@ package com.ichi2.libanki import androidx.annotation.VisibleForTesting import anki.cards.FsrsMemoryState import anki.decks.deckId -import anki.notes.noteId import com.ichi2.anki.Flag import com.ichi2.anki.utils.ext.ifZero +import com.ichi2.annotations.NeedsTest import com.ichi2.libanki.Consts.CardQueue import com.ichi2.libanki.Consts.CardType import com.ichi2.libanki.TemplateManager.TemplateRenderContext.TemplateRenderOutput @@ -233,7 +233,8 @@ open class Card : Cloneable { } @LibAnkiAlias("current_deck_id") - fun currentDeckId() = deckId { did = oDid.ifZero { did } } + @NeedsTest("Test upstream functionality which calls this") + fun currentDeckId() = deckId { did = oDid.ifZero { this@Card.did } } /** * Time limit for answering in milliseconds.