03-08-2017, 02:03 PM | #1 |
Grand Sorcerer
Posts: 6,328
Karma: 12117215
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Problem with template functions and library maintenance
Hi,
As I'm much more fluent in python language than template definition, I have a lot of template functions that I call directly in custom columns. I've seen today that, after a library maintenance, the custom columns get broken because the template functions disappear (they are not there when you go into Preferences->Template functions). If you change the library and go back again, the functions are already there. Is this normal? Thank you |
03-08-2017, 03:32 PM | #2 |
Grand Sorcerer
Posts: 11,915
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
That means that I forgot to load the template functions after the database is closed, vacuumed, then reopened. I will look into fixing it.
Fortunately you have an easy workaround. |
Advert | |
|
03-08-2017, 03:34 PM | #3 |
Grand Sorcerer
Posts: 6,328
Karma: 12117215
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Thank you, and yes, easy workaround after the first moment of panic goes away
Last edited by Terisa de morgan; 03-08-2017 at 03:51 PM. |
03-11-2017, 03:48 PM | #4 |
Grand Sorcerer
Posts: 11,915
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Kovid accepted the fix, which is now in source. Let me know if it doesn't fix your problem.
|
03-11-2017, 03:58 PM | #5 |
Grand Sorcerer
Posts: 6,328
Karma: 12117215
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
I'll tell you in the next release, yes (I don't usually run from source). Thank you very much for the fix.
|
Advert | |
|
03-11-2017, 04:17 PM | #6 | |
null operator (he/him)
Posts: 20,890
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Seems vaguely similar, the workaround is do library switches or a restart. BR Last edited by BetterRed; 03-11-2017 at 06:46 PM. |
|
03-11-2017, 04:42 PM | #7 | |
Grand Sorcerer
Posts: 11,915
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
NB: I tried creating a new custom column, "column built from other columns, behaves like tags" with the template {:'virtual_libraries()'}. It is a totally new column using a never-before-used lookup name. I had to restart to see the column at all, and after that it worked fine with no "recursion" error message. I also tried changing the template for an existing custom column and had no problems. I don't know why others are seeing the error. I suspect that people are reusing lookup names, something that is known to be problematic, but that is at best a suspicion. |
|
03-11-2017, 05:47 PM | #8 |
null operator (he/him)
Posts: 20,890
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@chaley - as I wrote 'seems vaguely similar'. Had it been the same I would have retracted my suggestion to Alaa that he report his problem as bug, and given him a link to this thread.
my '#location/Location' column is a pre-existing a long text column, not that it's type should make any difference. I just restored my Test library to Thursday evening my time. I created the 'Has Location' virtual library and the '#virtlib/Virtual Libraries' column and did a restart. Then I added the Virtual Libraries column to the Book List, via right click headers and Show Columns. The first item had the correct value in Virtual Libraries, but the rest (including those with nothing in Location) had a TEMPLATE ERROR ... message. Did a restart and everything was OK. But as I mentioned, my tests are on my kitchen sink test library. I will redo on a fresh library when I'm less busy. I have a new screen recorder toy - I could try it out at the same time BR Last edited by BetterRed; 03-11-2017 at 05:56 PM. |
03-11-2017, 05:58 PM | #9 | |
null operator (he/him)
Posts: 20,890
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
03-11-2017, 05:59 PM | #10 |
Grand Sorcerer
Posts: 11,915
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@BR: my apologies for sounding testy. Life is a bit complicated here ...
Clearly there is something wrong given that several people have seen the problem. My problem is that I can't repeat it so I have no idea where to look. I have tried creating a new column, hiding and restoring a column, and sitting for 5 minutes chanting "ooomm", all without a failure. Eating a bowl of ice cream didn't work either. If your tests come up with something repeatable then I will be happy to look at it and (I hope) fix it. Or even if things aren't repeatable but provide enough pointers for where to look. |
03-11-2017, 05:59 PM | #11 |
Grand Sorcerer
Posts: 11,915
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
03-11-2017, 06:06 PM | #12 |
null operator (he/him)
Posts: 20,890
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
03-11-2017, 09:43 PM | #13 |
null operator (he/him)
Posts: 20,890
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@chaley - see post #8 in ==>> Column to show mags. that are NOT in any virtual Libraries
Good and not so good news awaits thee. BR |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Missing Library/Library Maintenance button | babyshelley | Library Management | 2 | 06-20-2015 01:05 PM |
Library maintenance -> Check library | mlevin77 | Library Management | 9 | 07-22-2014 08:03 PM |
template: if one of the tag is something... maybe contains or in_list functions | fxp33 | Calibre | 4 | 07-19-2014 05:18 AM |
Making references to other fields in template functions | Ruskie_it | Library Management | 10 | 12-21-2011 10:53 PM |
Does anyone use "general program mode" template functions? | chaley | Library Management | 0 | 08-16-2011 11:54 AM |