work around a couple restrictions that the native stringbundle has
authorGalen Charlton <gmc@esilibrary.com>
Thu, 14 Feb 2013 23:52:53 +0000 (18:52 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 14 Feb 2013 23:57:25 +0000 (18:57 -0500)
commit439d6681a26d9b0774b1c4db74c132eb08f6823f
treebdde61116576a2e5a845b104b1447d68c6e13064
parentf6a7f97c4002649d01eb111761fa9d35c5ff45e8
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/chrome/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/patron/bill2.js