To recreate: 1. Set ClaimReturnedLostValue to a LOST value 2. Check out an item to a patron. 3. Click the Claim returned button within the checkout table. 4. Get spinning icon in place of the button 5. In the web developer tools console: Uncaught TypeError: value.match is not a function Looks like this is coming from includes/js-date-format.inc: 46 if ( ! value.match(/^\d{4}-\d{2}-\d{2}$/ ) ) { 47 m = m.tz(tz); 48 }
match() matches a string against a regular expression. We need to make sure the value passed is a string.
Created attachment 150248 [details] [review] Bug 33616: Make sure match() is evaluated against a string To Test: 1. Set ClaimReturnedLostValue to a LOST value 2. Check out an item to a patron. 3. Click the Claim returned button within the checkout table. 4. Get spinning icon in place of the button 5. In the web developer tools console: Uncaught TypeError: value.match is not a function 6. Apply patch 7. Try 2 - 3 again. This time the spinning icon should turn into a grey button with the correct date. 8. There should no longer be a console error.
Created attachment 150249 [details] [review] Bug 33616: Make sure match() is evaluated against a string To Test: 1. Set ClaimReturnedLostValue to a LOST value 2. Check out an item to a patron. 3. Click the Claim returned button within the checkout table. 4. Get spinning icon in place of the button 5. In the web developer tools console: Uncaught TypeError: value.match is not a function 6. Apply patch 7. Try 2 - 3 again. This time the spinning icon should turn into a grey button with the correct date. 8. There should no longer be a console error. Signed-off-by: David Nind <david@davidnind.com>
(In reply to Lucas Gass from comment #1) > match() matches a string against a regular expression. We need to make sure > the value passed is a string. Looks good to me. Do you know what you got that triggered the type error? In theory we could pass something that may not have a toString method too and cause a new error? Probably not reproducable :)
I think this is now a duplicate of Bug 33621.
*** This bug has been marked as a duplicate of bug 33621 ***