`unknown function` when referencing stored template "function" in `epub:save_to_disk` plugboard template

Bug #2049992 reported by Nathan Dines
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Charles Haley

Bug Description

As indicated in the title, when referencing a stored template in the plugboard template for `epub:save_to_disk`, the output ends up including `zero_pad_series: unknown function` inline in the title.

The plugboard template is: `{series}{series_index:zero_pad_series()| [|] - }{title}{#subtitle:|: |}`

The stored template (prefixed with a line of `python:` when applying it in Calibre) can be found at the following link: https://github.com/nathandines/calibre-template-functions/blob/4f78e9edf40caa487ae93b246404af16d6207375/src/calibre_template_functions/zero_pad_series.py

This template works perfectly when using the `any format:KINDLE2` plugboard with the same plugboard template, but does not work with `epub:save_to_disk`. For the sake of testing, I'm also seeing the same issue when using `pdf:save_to_disk`.

Is there perhaps an issue with stored templates being imported when plugboards are being used for `save_to_disk`? I haven't had a chance to dig into the source code of Calibre myself.

Calibre Version: 7.3.0
Operating System: macOS 13.5.2

Revision history for this message
Kovid Goyal (kovid) wrote :

Changing the component for this bug.

 assignee
 status

Changed in calibre:
assignee: nobody → Charles Haley (cbhaley)
status: New → Triaged
Charles Haley (cbhaley)
Changed in calibre:
status: Triaged → Fix Committed
Revision history for this message
Kovid Goyal (kovid) wrote :

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

Changed in calibre:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.