I noticed that when a number TV has the value 0 and is edited in NewsPublisher, the input field is left empty. So after saving, the TV is now empty. Is this expected behaviour? I'd expect "no value" would be different from 0, just like in the modx manager.
(In my use case we ask for a recommended minimum age for an event. If the editor says 0, then it's for all ages, if she gives no information, we assume it's for adults only.)
How can this be fixed?
I can't see any easy way to fix this in the code, but if I have time, I'll take another look.
It might possibly work to alter the NewsPublisher npIntTpl chunk. Back it up first, then try changing this part:
value="[[+np.[[+npx.fieldName]]]]"
to this:
value="[[+np.[[+npx.fieldName]]:empty=`0`]]"
You could use JavaScript to change the display of that specific field if it's empty. I think the ID would be np.
tvName. You could find out by examining it in Chrome or Firefox dev. tools.
In JQuery, it would be something like this:
var value = $('#np.tvName').val();
if (empty(value)) {
$('#np.tvName').val('0');
}