jdlorimer/chinese-support-redux

Bulk Fill fails with exception due to KeyError for 'transcription'

Closed this issue · 3 comments

Describe the bug
Bulk fill fails due to a KeyError for 'transcription'.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the deck to bulk fill.
  2. Click on the drop-down menu item 'Chinese > Bulk Fill > Transcription'
  3. See error
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-ons section of our support site. 
Debug info:
Anki 2.1.13 (3ba55990) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Mac 10.14.6
Flags: frz=True ao=True sv=1
Add-ons possibly involved: Chinese Support Redux v0115

Caught exception:
  File "/Users/me/Library/Application Support/Anki2/addons21/1128979221/fill.py", line 147, in bulk_fill_transcript
    ['transcription', 'pinyin', 'pinyinTaiwan', 'cantonese', 'bopomofo']
  File "/Users/me/Library/Application Support/Anki2/addons21/1128979221/config.py", line 59, in get_fields
    fields.extend(self.config['fields'][g])
<class 'KeyError'>: 'transcription'

Expected behavior
Bulk fill happens.

Specs (please complete the following information):

  • OS: [e.g. Windows, iOS, Ubuntu]: MacOS 10.14
  • Anki Version [e.g. v2.0.52, v2.1.5]: v2.1.13
  • Chinese Support Version [e.g. v0.5.3-beta] v0115

Additional context

Looking at fill.py line 147 the offending line seems to be this:

    fields = config.get_fields(
        ['transcription', 'pinyin', 'pinyinTaiwan', 'cantonese', 'bopomofo']
    )

The other fields exist in the config, but not 'transcription'.

Thanks!
Could you please comment, why the options for bulk fill changed so drastically from 11.0 to 11.5 beta?
The old menu items names seemed so much more meaningful to me.

I don't know, I'm not the maintainer, @luoliyan is.

@telotortium Thanks for the patch.

@JanOetting I recall changing the names, but not my reasoning. Given that the underlying code changed so much, I suspect the menu names were no longer accurate.