View Single Post
Old 09-18-2016, 04:26 AM   #15
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
But... it wasn't there before and I haven't changed the template... well, I'll send you the metadata.db, sorry for being an annoyance.
Whew (at least from my point of view), this one isn't a calibre bug.

The column #sak has the Single Function Mode template
Code:
{series:test(S:{series},{author})}
Templates embedded into templates are to be avoided in Single Function Mode because the inner templates are expanded before the template is parsed. This evaluation order means that if an item such as {series} contains a comma then that comma becomes an argument separator. That is why the documentation has the big bold sentence Do not use subtemplates (`{ ... }`) as function arguments. In that metadata.db there are 5 series names that contain a comma.

You can avoid this problem by using Template Program Mode
Code:
{series:'test($, strcat('S:', $), field('authors'))'}
or the equivalent in General Program Mode.
chaley is offline   Reply With Quote