Custom collumn returns "TEMPLATE ERROR list index out of range"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Charles Haley |
Bug Description
Hello. Since last update I did (5.27, but still occurs in 5.28), one of my custom collums randomly returns "TEMPLATE ERROR list index out of range"
Screenshot below
https:/
The formula for this collum is {#authors_
The idea is that when there are multiple authors, they are separated by a , and not a &
This allows my kobo to detect multiple authors for a book, instead of thinking that it's a single author named "author1 & author2"
Regarding #authors_
The formula for it is {authors:
To be noted: there is no error anywhere in the calculation for this formula. Only in the calculation of the first formula in this bug report
What is more weird: when I click on the field displaying "TEMPLATE ERROR list index out of range", it opens the "edit template" window, showing the formula. And in this window, the result is correct, and shows the correct author name.
See screenshot there: https:/
If I click OK, then the complete database is recalculated, but for some reason, the bug reappears (and not always on the same books)
Changed in calibre: | |
status: | New → Incomplete |
I need an exception trace. Run calibre in debug mode (click the down arrow on Preferences and choose Restart in debug mode) and post the exception(s) from the log.
FWIW: your #authors_ namesinverted column can be better expressed as 'list_re_ group($ , ' & ', '.', '(^.*$)', '[[$:swap_ around_ comma() ]]')'} group($ authors, ' & ', '.', '(^.*$)', '{$:swap_ around_ comma() }')
{authors:
or as I would prefer:
program: list_re_
And unless you have a reason to have two columns I would do this to build the inverted comma-separated list directly from the authors column: comma(author) ;
program:
res = '';
for author in $authors separator ' & ':
author = swap_around_
if !res then
res = author
else
res = strcat(res, ', ', author)
fi
rof
I included the above in the attached txt file in case launchpad breaks the lines in strange ways