From: Jeff Davis Date: Tue, 28 Apr 2015 16:33:52 +0000 (-0700) Subject: Truncated totals on account summary due to bad regex X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5ddc721391b77fc009e10b0fff60c7e9cbc21ece;p=contrib%2Foverdrive-eg-opac.git Truncated totals on account summary due to bad regex On the account summary page, OD API was using /\d+?/ to scrape item totals. In Javascript, this regular expression matches the minimum possible match, i.e. one digit, even when the total had more than one digit. So, for example, if a patron had 10 items out, the checked out totals on the account summary page in OD API would show 1 item out. (The totals at the top right of the page are correct.) This commit fixes the regex. Signed-off-by: Jeff Davis --- diff --git a/src/od_pages_myopac.coffee b/src/od_pages_myopac.coffee index 4e7c7d4..106a578 100644 --- a/src/od_pages_myopac.coffee +++ b/src/od_pages_myopac.coffee @@ -64,7 +64,7 @@ define [ if arguments.length is 0 # Parse a list of totals of physical items from the account summary table - totals = ( +(v.textContent.match(/\d+?/)[0]) for v in @find('td').not '[align="right"]' ) + totals = ( +(v.textContent.match(/\d+/)[0]) for v in @find('td').not '[align="right"]' ) tpl = _.template """