fonol / anki-search-inside-add-card

An add-on providing full-text-search and PDF reading functionality to Anki's Add card dialog
https://ankiweb.net/shared/info/1781298089
GNU Affero General Public License v3.0
179 stars 24 forks source link

Fix: 'Collection"'object has no attribute '_startTime' #215

Closed p4nix closed 3 years ago

p4nix commented 3 years ago

A user on Discord reported this error to me:

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 on the add-on support site.
Debug info:
Anki 2.1.40 (cf446733) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.13.6
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-02-16 09:34:44
Add-ons possibly involved: ⁨Searching PDF Reading  Note-Taking in Add Dialog⁩

Caught exception:
Traceback (most recent call last):
  File "aqt/webview.py", line 35, in cmd
  File "aqt/webview.py", line 124, in _onCmd
  File "aqt/webview.py", line 563, in _onBridgeCmd
  File "aqt/hooks_gen.py", line 3119, in __call__
  File "/Users/***/Library/Application Support/Anki2/addons21/1781298089/src/command_parsing.py", line 1214, in expanded_on_bridge_cmd
    mw.moveToState("review")
  File "aqt/main.py", line 646, in moveToState
  File "aqt/main.py", line 668, in _reviewState
  File "aqt/reviewer.py", line 72, in show
  File "aqt/reviewer.py", line 92, in nextCard
  File "anki/collection.py", line 542, in timeboxReached
AttributeError: 'Collection' object has no attribute '_startTime'

This can occur if a user has not started the collection timebox yet (by reviewing a few cards), but opens a PDF and reviews any unseen cards (filtered deck "PDF Reviews"). Bug fixed by starting the timebox before moving to "review" state: mw.col.startTimebox()

fonol commented 3 years ago

Thanks!

fonol commented 3 years ago

Fix is on Ankiweb