View Single Post
Old 03-15-2021, 11:12 PM   #392
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,109
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I have this template for single field edit an integer column:

Code:
program:
	if raw_field('#percentread') ==# '0' then '1'
	fi
However this turns everything else into undefined. I noticed the template tester returned a blank value when making the template but i was not expecting it to change.

This worked and did not change other values:

Code:
program:
	if raw_field('#percentread') ==# '0' then '1'
	else raw_field('#percentread')
	fi
Is this expected behaviour? I would think that unless the template had else '' for a deliberate null the user would want it to remain the same. Though perhaps it can't tell the difference between a deliberate null and no output.

Last edited by ownedbycats; 03-16-2021 at 12:55 AM.
ownedbycats is offline   Reply With Quote