View Single Post
Old 03-11-2017, 09:39 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@Alaa - don't worry about reporting the 'bug', I took it up with chaley in this thread ==>> Problem with template functions and library maintenance

@chaley - I did some tests on an fresh empty library and I could not reproduce the TEMPLATE ERROR... I saw previously. Happy to write that down to me not doing a restart when I should have done, or using a much abused library

But I did find an anomaly that could be related. Here is a blow-by-blow script of what I did (twice - i.e. it's repeatable)

Code:
create two custom columns - 
	#first_location/First Location, 
             Long text . . . 
             header on the side,
             HTML
	#second_location/Second Location, 
             Long text . . . 
             header on the side, 
             HTML
	Apply and Restart
create two virtual libraries
	Has First Loc, #first_location:true
	Has Second Loc, #second_location:true 
create two custom columns (to test if tags-like was relevant - it seems not) 
	#virtlibs_like_tags/Virtual Lib Like Tags, 
		column built from other columns, behaves like Tags, 
		Sort/search column by Text, 
		Show in tags browser: unchecked, 
		Show as HTML in book details unchecked 
	#virtlibs_not_tags/Virtual Lib Not Tags, 
		column built from other columns, 
		Sort/search column by Text, 
		Show in tags browser: unchecked, 
		Show as HTML in book details unchecked 
		Apply and Restart
Put some data in First Location and Second Location- everything OK, the two VL columns were updated dynamically and no TEMPLATE Error... msgs.

Added a Third Location, same as First and Second, Put some HTML values into Third Location.

Added another VL - Has Third Loc, books with a Third Location appeared in the VL. However the Virtual Libs columns didn't update to show the Has Third Loc VL . . . until I did a restart

But once I'd done a restart. the Virt Lib columns updated dynamically.

Looks to me if as the template {:'virtual_libraries()'} is only evaluated (goes looking for VLs) when a library is opened. Ideally I guess it should refresh if a VL is added, edited, or removed, or less ideally any VL add/edit/remove should ask for a restart a'la custom columns...

Hope this makes sense

BR

Last edited by BetterRed; 03-12-2017 at 05:33 AM.
BetterRed is offline   Reply With Quote