AnKing-VIP / Advanced-Card-Styles

GNU Affero General Public License v3.0
5 stars 4 forks source link

Bug report #1 #5

Closed gustavosmendes closed 2 years ago

gustavosmendes commented 3 years ago

Problem description

I opened the card style via enhanced cloze v2 or from AnKing and the error appeared.

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

Please fill out the section corresponding with your Anki version:

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):

Anki 2.1.48 (af2ec0b9) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2021-09-19 10:49:16

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AJT Mortician ['1255924302', 2021-09-17T02:52, 'None', mod]
Advanced Browser ['874215009', 2021-07-22T18:14, 'None', '']
Advanced Card Styles ['1625103157', 2021-09-19T08:36, 'None', '']
Advanced Copy Fields ['1898445115', 2019-05-03T15:46, 'None', '']
Advanced Review Bottom Bar ['1136455830', 2021-09-15T03:29, 'None', mod]
Always On Top ['1760080335', 2019-06-29T03:45, 'None', '']
Anki Zoom ['538879081', 2020-04-03T21:20, 'v1.1.3', mod]
AnkiOCR ['450181164', 2021-09-19T02:55, 'None', mod]
AnkiWebView Inspector ['31746032', 2019-05-02T19:43, 'None', '']
Batch Editing ['291119185', 2019-06-02T15:47, 'None', '']
BetterSearch ['1052724801', 2021-08-04T17:51, 'None', '']
Collapsible Fields ['1896168623', 2021-08-28T18:45, 'None', '']
Colorful Tags ['594329229', 2021-09-01T23:02, 'None', '']
Customize Keyboard Shortcuts ['24411424', 2021-07-07T01:28, 'None', mod]
Edit Field During Review Cloze ['385888438', 2021-07-31T02:57, '6.7', mod]
Enhanced Cloze for Anki 21 ['1990296174', 2021-09-16T11:22, 'None', '']
Exam Notifier ['exam_notifier', 2021-09-02T09:35, 'None', '']
Extended Tag AddEdit Dialog ['1135507717', 2021-05-18T21:29, 'None', '']
Fastbar- with nightmode support ['46611790', 2021-08-22T17:33, 'None', '']
Field AutoComplete ['511710206', 2021-09-09T12:08, 'None', mod]
Find and Replace in Card templatesNotetypesHTML ['992153575', 2021-09-17T03:34, 'None', '']
Google Translate ['1536291224', 2021-09-12T13:25, 'None', mod]
Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-27T23:21, 'None', '']
MotivAnki ['motivanki', 2020-07-17T16:26, 'None', mod]
New Card Counter ['new_card_counter', 2021-06-09T12:48, 'None', '']
Pop-up Dictionary ['popup_dictionary', 2021-08-04T19:30, 'None', '']
ReColor ['ReColor', 0, '1.0', mod]
Remaining time for Anki 21 ['1508357010', 2020-12-13T11:14, '20.12.13i151', mod]
Reset Ease Automatically ['12081346', 2021-04-16T07:02, 'None', mod]
Review Heatmap ['review_heatmap', 2020-04-30T10:23, 'None', '']
Special Fields ['1102281552', 2021-06-20T18:27, 'None', mod]
Symbols As You Type ['2040501954', 2021-03-21T23:17, 'None', '']
The KING of Study Timers ['907028815', 2021-09-03T14:17, 'None', mod]
remove linebreaks  do word wrap ['2028179508', 2021-04-11T20:36, 'None', '']

===IDs of active AnkiWeb add-ons===
1052724801 1102281552 1135507717 1136455830 12081346 1255924302 1374772155 1508357010 1536291224 1625103157 1760080335 1896168623 1898445115 1990296174 2028179508 2040501954 24411424 291119185 31746032 385888438 450181164 46611790 511710206 538879081 594329229 874215009 907028815 992153575

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Anki Excel Sync ['1832015432', 2021-01-28T00:53, 'None', mod]
Custom Styles font color background colour classes ['1899278645', 2021-03-02T21:41, 'None', '']
If you are using Anki 2.0

Please open Anki, go to Help → About, find the two lines starting with Version: and Qt, and copy-paste them between the backticks below:

Please fill in details about your operating system (Windows/macOS/Linux, which version):

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:

Error message (if any)

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 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.48 (af2ec0b9) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=3 Add-ons, last update check: 2021-09-19 10:49:16

Caught exception: Traceback (most recent call last): File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\Buttons.py", line 246, in advancedEditorButtonAction a.loadUI(self.clayout) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\AdvancedStylerGui.py", line 65, in loadUI self.loadSettingsFromCss(text) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\AdvancedStylerGui.py", line 132, in loadSettingsFromCss self.profile.initializeFromCssString(filePath, "Custom") File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\CssProfile.py", line 47, in initializeFromCssString self.rootList = createRootListFromCssString(cssString) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\myCssParser.py", line 64, in createRootListFromCssString newDict = convertRuleContentToOrderedDict(rule.content) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\myCssParser.py", line 89, in convertRuleContentToOrderedDict a = parse_declaration_list(ruleContent, skip_comments=True, skip_whitespace=True) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\tinycss2\parser.py", line 172, in parse_declaration_list tokens = _to_token_iterator(input, skip_comments) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\tinycss2\parser.py", line 17, in _to_token_iterator return iter(input) TypeError: 'NoneType' object is not iterable

gustavosmendes commented 3 years ago

Also, fix the description of the addon.

Initially says it doesn't work on 2.1.26+ and the changelog says the opposite

zxcvbn2949 commented 3 years ago

Same problem.

RisingOrange commented 3 years ago

Thanks for reporting here, I fixed the description. Does the error show up with other note types too or just with Enhanced Cloze v2 and the one from Anking?

It would be helpful if you could post the contents of the Styling field in the card type editor of the card types it happens with.

gustavosmendes commented 3 years ago

I Will check it later :)

gustavosmendes commented 3 years ago

Tried with all addons disabled. Almost every note type the message appeared, BUUUUT... I found the main reason for conflict.

When you use https://ankiweb.net/shared/info/1899278645, it adds this "@import url("_editor_button_styles.css");" to styling. When deleted, the addon does not send an error message. However, I haven't tested other features of your addon.

If you delete the part of the styling, it seems to works fine.

gustavosmendes commented 3 years ago

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 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.48 (af2ec0b9) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=3 Add-ons, last update check: 2021-09-19 10:49:16

Caught exception: Traceback (most recent call last): File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\Buttons.py", line 246, in advancedEditorButtonAction a.loadUI(self.clayout) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\AdvancedStylerGui.py", line 65, in loadUI self.loadSettingsFromCss(text) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\AdvancedStylerGui.py", line 132, in loadSettingsFromCss self.profile.initializeFromCssString(filePath, "Custom") File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\CssProfile.py", line 47, in initializeFromCssString self.rootList = createRootListFromCssString(cssString) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\myCssParser.py", line 64, in createRootListFromCssString newDict = convertRuleContentToOrderedDict(rule.content) File "C:\Users\gusta\AppData\Roaming\Anki2\addons21\1625103157\myCssParser.py", line 99, in convertRuleContentToOrderedDict orderdRule[dec.name] = str(serialize(dec.value)).strip(' ') AttributeError: 'ParseError' object has no attribute 'value' . On AnKing, the addon does not work properly. Looks like it needs an initial value to work.

RisingOrange commented 3 years ago

Uploaded a fix for the Advanced Styles incompatibility to AnkiWeb. Thanks for the hint with the "@import url("_editor_button_styles.css");" statement!

gustavosmendes commented 3 years ago

@RisingOrange I still have some errors. Please check with others if there are any errors in the anking card. I'll check if there is any conflict with another addon.

RisingOrange commented 3 years ago

You mean the Anking Cloze template right? I didn't get any errors with it. Can you send me the styling information from the Styling field in the editor?

gustavosmendes commented 3 years ago

Sure. I'll send it by email, okay?

RisingOrange commented 3 years ago

Ok I won't have time to have a look at it immediately though

RisingOrange commented 2 years ago

This issue doesn't occur with the updated AnKing notetypes anymore. They previous versions contained a syntax error in the css which caused this.