work around a couple restrictions that the native stringbundle has
This patch fixes an issue where paying a fine would result
in the following error message in the staff client:
Error logging payment in bill.2js:[Exception… “Component returned failure code:0x80070057
(NS_ERROR_ILLEGAL_VALUE) [nsIStringBundle.formatStringFromName]” nsresult:”0x80070057
(NS_ERROR_ILLEGAL_VALUE)” location: “JS frame::XStringBundle::getFormattedString::line33”
data:no]
The getFormattedString() method of the native XUL stringbundle
has a couple problems:
[1] There's an undocumented limit of 10 substitution parameters; if
more than 10 are supplied, it throws an NS_ERROR_ILLEGAL_VALUE
exception.
[2] It requires that *all* of the substitution parameters be
listed in the format string; if you skip one, it throws (confusingly)
an NS_ERROR_OUT_OF_MEMORY memory.
The two workarounds:
- arbitrarily drop three of the previous work_log variable for fine payments
that used to be available
- include all of the positions in the format string, but use zero width
for the ones we're not interested in including in the log message.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>