LP#
1861732 - Allow copy template stat cat unset value (-1)
Xul copy templates allowed the user to save an unset value for a stat_cat,
which was stored as -1 in the xul copy template. When those values are migrated
to the webstaff client copy templates, the -1 value is preserved. But that value
is passed directly to the database when saving a record, and -1 isn't a valid
value.
This change treats -1 the same as null or a blank line when applying the template, which
allows the template to unset a stat cat value like before in the XUL client.
Testing Notes:
1. Create some copy stat cats if they don't exist.
2. Clear out actor.usr_settings for the testing user, mainly the webstaff copy template key
of 'webstaff.cat.copy.templates'.
3. In XUL client, create a copy template that includes setting a stat cat to the "<Remove Stat Cat>"
value.
4. In the webstaff client, edit an item and try to apply the migrated copy template.
Before fix - you won't be able to save the copy after applying the template, it will
just silently fail. If you check the postgres logs you will see an error about trying
to set the stat cat value to -1.
After fix - You will be able to save the copy after applying the template, and if a value
for that stat cat was already set, it will be unset by the template.
Signed-off-by: Josh Stompro <stompro@stompro.org>