diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index 067290342..7def6df53 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -144,7 +144,7 @@ class AddCards(QDialog): def onHistory(self) -> None: m = QMenu(self) for nid in self.history: - if self.mw.col.findNotes("nid:%s" % nid): + if self.mw.col.findNotes(self.col.search_string(nids=[nid])): note = self.mw.col.getNote(nid) fields = note.fields txt = htmlToTextLine(", ".join(fields)) @@ -162,7 +162,7 @@ class AddCards(QDialog): def editHistory(self, nid): browser = aqt.dialogs.open("Browser", self.mw) - browser.form.searchEdit.lineEdit().setText("nid:%d" % nid) + browser.form.searchEdit.lineEdit().setText(self.col.search_string(nids=[nid])) browser.onSearchActivated() def addNote(self, note) -> Optional[Note]: diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index e1e474e38..603c47d31 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -1705,7 +1705,7 @@ where id in %s""" t += ( """
  • %s: %s""" % ( - self.col.search_string(nids=nids).replace('"', '"'), + self.col.search_string(nids=nids).replace('"', """), tr(TR.BROWSING_NOTE_COUNT, count=len(nids)), html.escape(val), ) diff --git a/qt/aqt/mediacheck.py b/qt/aqt/mediacheck.py index 092689a8d..76456a860 100644 --- a/qt/aqt/mediacheck.py +++ b/qt/aqt/mediacheck.py @@ -146,7 +146,8 @@ class MediaChecker: if out is not None: nid, err = out browser = aqt.dialogs.open("Browser", self.mw) - browser.form.searchEdit.lineEdit().setText("nid:%d" % nid) + search = self.mw.col.search_string(nids=[nid]) + browser.form.searchEdit.lineEdit().setText(search) browser.onSearchActivated() showText(err, type="html") else: