Fix regression that caused tags to not be sorted when displayed in the book details panel. Fixes #1351622 [tags are not shown alphabetically in Book Details Window](https://bugs.launchpad.net/calibre/+bug/1351622)

This commit is contained in:
Kovid Goyal 2014-08-02 20:45:10 +05:30
parent 6a1f82320d
commit c148102a5f

View File

@ -194,9 +194,12 @@ def mi_to_html(mi, field_list=None, default_author_link=None, use_roman_numbers=
st = metadata['search_terms'][0]
except Exception:
st = field
all_vals = mi.get(field)
if field == 'tags':
all_vals = sorted(all_vals, key=sort_key)
links = ['<a href="%s" title="%s">%s</a>' % (
search_href(st, x), _('Click to see books with {0}: {1}').format(metadata['name'], x), x)
for x in mi.get(field)]
for x in all_vals]
val = metadata['is_multiple']['list_to_ui'].join(links)
elif metadata['datatype'] == 'enumeration':
try: