diff --git a/src/calibre/db/search.py b/src/calibre/db/search.py index c4610bc126..88ca72ee45 100644 --- a/src/calibre/db/search.py +++ b/src/calibre/db/search.py @@ -643,9 +643,12 @@ class Parser(SearchQueryParser): # {{{ matchkind, query = _matchkind(query, case_sensitive=case_sensitive) matches = set() error_string = '*@*TEMPLATE_ERROR*@*' + template_cache = {} for book_id in candidates: mi = self.dbcache.get_proxy_metadata(book_id) - val = mi.formatter.safe_format(template, {}, error_string, mi) + val = mi.formatter.safe_format(template, {}, error_string, mi, + column_name='search template', + template_cache=template_cache) if val.startswith(error_string): raise ParseException(val[len(error_string):]) if sep == 't':