AnKing-VIP / advanced-browser

Anki add-on with card browser enhancements.
GNU General Public License v3.0
56 stars 13 forks source link

Add-on doesn't work in Anki 23.10 beta6 (ValueError: Protocol message Column has no "sorting" field.) #167

Closed CrAZONE0 closed 11 months ago

CrAZONE0 commented 11 months ago

Anki 23.10 Platform: Windows 11

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 to the add-on author.
Debug info:
Anki 23.10 (72e57456) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2
Platform: Windows-10-10.0.22624
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-10-14 17:16:36
Add-ons possibly involved: ⁨Advanced Browser⁩

Caught exception:
Traceback (most recent call last):
  File "aqt.main", line 1210, in onBrowse
  File "aqt", line 130, in open
  File "aqt.browser.browser", line 144, in __init__
  File "_aqt.hooks", line 1428, in __call__
  File "C:\Users\craz\AppData\Roaming\Anki2\addons21\874215009\advancedbrowser\core.py", line 43, in _load
    runHook("advBrowserLoaded", self)
  File "anki.hooks", line 34, in runHook
  File "C:\Users\craz\AppData\Roaming\Anki2\addons21\874215009\advancedbrowser\note_fields.py", line 37, in onAdvBrowserLoad
    self.buildMappings()
  File "C:\Users\craz\AppData\Roaming\Anki2\addons21\874215009\advancedbrowser\note_fields.py", line 138, in buildMappings
    self.advBrowser.setupColumns()
  File "C:\Users\craz\AppData\Roaming\Anki2\addons21\874215009\advancedbrowser\core.py", line 95, in setupColumns
    self.table._model.columns[key] = BuiltinColumn(
ValueError: Protocol message Column has no "sorting" field.
abdnh commented 11 months ago

For maintainers - see fix here: https://github.com/open-spaced-repetition/fsrs4anki-helper/issues/265#issuecomment-1762471447

khonkhortisan commented 11 months ago

workaround?

            self.table._model.columns[key] = BuiltinColumn(
                key=key,
                cards_mode_label=column.name,
                notes_mode_label=column.name,
                #sorting=bc if column.onSort() else BrowserColumns.SORTING_NONE,
                sorting_notes=bc if column.onSort() else BrowserColumns.SORTING_NONE,
                sorting_cards=bc if column.onSort() else BrowserColumns.SORTING_NONE,
                uses_cell_font=False,
                alignment=alignment,
            )
CrAZONE0 commented 11 months ago

workaround?

            self.table._model.columns[key] = BuiltinColumn(
                key=key,
                cards_mode_label=column.name,
                notes_mode_label=column.name,
                #sorting=bc if column.onSort() else BrowserColumns.SORTING_NONE,
                sorting_notes=bc if column.onSort() else BrowserColumns.SORTING_NONE,
                sorting_cards=bc if column.onSort() else BrowserColumns.SORTING_NONE,
                uses_cell_font=False,
                alignment=alignment,
            )

Seems to work fine on my end. Unfortunately the repository doesn't seem to be very well monitored so I'm not sure if the add-on will be updated. Anyway thank you.

ijgnd commented 11 months ago

Thanks @CrAZONE0 for reporting the problem in the right place and thanks @khonkhortisan, @abdnh for the quick fix.

I just added the discussed fix.

Before this new version is uploaded to Ankiweb I think it should be tested by some people The new version from: https://github.com/AnKing-VIP/advanced-browser/releases/download/v4.4/Advanced_Browser__branch_idx_5__AnkiVers_231000-231000__2023-10-15.ankiaddon

Note: this new version won't work in 2.1.66.

If there are no new posts in the coming days I assume that the new version works and can be uploaded to Ankiweb.

I just saw the downvote concerning the problem in Anki 23.10 on https://ankiweb.net/shared/info/874215009 . If one of the participants posted this negative review I suggest to adjust it due to this fix.

@CrAZONE0: Indeed there's little activity in this repo but I think that (apart from the problem discussed in this thread) there are no relevant open bugs at the moment.

ijgnd commented 11 months ago

@AnKingMed :

The addon Advanced Browser will be broken in the upcoming Anki v23.10. The release of Anki v23.10 is imminent - there's already a RC.

A fixed version of the addon Advanced Browser can be found at https://github.com/AnKing-VIP/advanced-browser/releases/download/v4.4/Advanced_Browser__branch_idx_5__AnkiVers_231000-231000__2023-10-15.ankiaddon

This file needs to be uploaded to Ankiweb. Note that this new version of Advanced Browser only works in Anki v23.10 but not in 2.1.66. So it must be only uploaded to a new branch on ankiweb. The Advanced Browser version for Anki 2.1.66 must not be changed.

The description on ankiweb should be updated, too. In the version history we are missing this:

4.4:
 - fix for Anki v23.10 or later (Thanks to khonkhortisan and abdnh)
4.3a (2023-07-01):
 - fix labels for Card Queue and Card Type column, Anki 2.1.45 or later

I made a distinct addon version only for Anki v23.10 because the addon Advanced Browser never had if–then–else control flows for different anki versions in the same addon version.

This new version of advanced browser has very few changes, see the commits from Oct 15, 2023. The latest release of Advanced Browser on ankiweb is from 2023-07-01 which was about publishing the fix from #165. For this upload to ankiweb from 2023-07-01 there was no corresponding tag in this git repository/release on the github page. So the list of changes between the last two git tags/versions on github is misleading.

thanks.

AnKingMed commented 11 months ago

I uploaded a new branch with the file you linked, updated the changelog and made the previous branch supported up to 66 (from 54). Let me know if there is anything else that needs to be done. Thanks for doing this!