From 5ddc721391b77fc009e10b0fff60c7e9cbc21ece Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Tue, 28 Apr 2015 09:33:52 -0700 Subject: [PATCH] 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 --- src/od_pages_myopac.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 """ -- 2.11.0