Error in the HTML editor

Hi;

Since version 2.1.41 I get an error message when I try to open the HTML editor:

An error has occurred. Please use Extras> Check Database to solve the problem.
If the problem persists, please refer to the support website with your problem. In this case, please include the following information in the problem report.
Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz = True ao = False sv = 2
Add-ons, last update check: 2021-03-10 00:03:08

Caught exception:
Traceback (most recent call last):
File “aqt \ webview.py”, line 526, in handler
File “aqt \ editor.py”, line 534, in
File “aqt \ editor.py”, line 581, in
File “aqt \ editor.py”, line 595, in _onHtmlEdit
TypeError: list indices must be integers or slices, not NoneType
(
Sorry, for my english. It was translated from google
GruĂź
Peter

Hallo Peter!

Tritt das Problem bei jeder Notiz/Karte auf?
In der Fehlermeldung steht, dass Du zuerst eine ĂśberprĂĽfung der Datenbank durchfĂĽhren solltest.

Das geht folgendermaĂźen:

image

Das Problem könnte auch an einem Add-on liegen

Mit Version 2.1.41 wurden tiefgreifende Veränderungen am Editor vorgenommen. Einige Add-on-Entwickler haben ihren Code noch nicht an die neue Anki-Version angepasst.

Hast Du irgendwelche Add-ons für Anki installiert? In dem Fall könnte es sein, dass eines deiner Add-ons noch nicht mit der aktuellen Anki-Version kompatibel ist.

Wenn Du beim nächsten Start des Programmes die Shift-Taste gedrückt hältst (während das Programm lädt), wird Anki ohne Add-ons gestartet. Tritt das Problem danach nicht mehr auf, liegt es an einem Add-on und Du wirst leider ein Add-on nach dem anderen deaktivieren müssen (und jeweils neu starten), um herauszufinden, an welchem Add-on es liegt.

Liebe GrĂĽĂźe,
Matthias

2 Likes

Vielen Dank fĂĽr die Antwort.
Also ich habe schon alle Add-Ons deaktiviert.
Aber ich habe heute festgestellt, das bei neuen(!) Karten, das Problem nicht auftritt

Bei alten Karten:

@dae, @hengiesel, I can reproduce the bug when the browser has just been opened. In that case, the toolbar is active even though no field line edit is.

@Brasil_2004, bekommst du den Fehler auch, wenn du vorher in ein Feld klickst (also z.B. auf „die Verschlechterung“ im letzten Bild)?

2 Likes

I have a separate user/database with all default settings and I could see the error when just selecting a card from the browser of type Cloze (default) and select the Edit HTML feature, all plugins disabled.

Debug info:

Anki 2.1.41 (312fa278) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2

Platform: Mac 10.15.7

Flags: frz=True ao=True sv=2

Add-ons, last update check: 2021-03-10 09:55:42

Caught exception:

Traceback (most recent call last):

File “aqt/webview.py”, line 526, in handler

File “aqt/editor.py”, line 534, in

File “aqt/editor.py”, line 581, in

File “aqt/editor.py”, line 595, in _onHtmlEdit

TypeError: list indices must be integers or slices, not NoneType

1 Like

Genauso ist es.
Ich habe das gleiche festgestellt, wenn ich eine neue Karte anlege.
Aber es funktioniert auch wenn ich tatsächlich irgendwo anders klicke.
Siehe das Video:
https://1drv.ms/v/s!ArHbAgrd99jdkMArM-I8ASllws7g8A?e=8bbxm2

Noch ein anderer kleiner BUG: Ich habe heute die neueste Version 2.1.42 heruntergeladen. In der Hilfe steht aber immer noch 2.1.41.

Und dann fĂĽr deine Hilfe.

1 Like

BTW this only happens in the Browser, triggering the same feature from the Decks view/window works.

@Rumo That seems like a regression from this PR. I’ll put up a fix.

3 Likes