work around a couple restrictions that the native stringbundle has
authorGalen Charlton <gmc@esilibrary.com>
Fri, 15 Feb 2013 00:02:11 +0000 (19:02 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 15 Feb 2013 00:02:11 +0000 (19:02 -0500)
commite8861b6860d3df00a6d0b52ced347656f62aaefb
treea1ef150100e65f4eb3b0e1c35d85fe9d786d42c2
parentdf876f4cd2887848fa325431d255711e019c4a6f
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>
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/patron/bill2.js