Some types of invalid ISBNs, when run throught C4::Koha::NormalizeISBN can produce ISBN objects that contain invalid ISBNs. This can be reproduced with an ISBN that has an invalid prefix, group code or publisher code. An example ISBN would be "0788893777 (2 DVD 45th ed)". When attempting to look up a record with such an ISBN, you will get an error along the lines of: Can't call method "as_string" on an undefined value Instead of checking for the BAD_ISBN state, we should be checking for the GOOD_ISBN state vi the method is_valid.
Created attachment 28203 [details] [review] Bug 12243 - Records with invalid ISBNs can cause searches to fail Some types of invalid ISBNs, when run throught C4::Koha::NormalizeISBN can produce ISBN objects that contain invalid ISBNs. This can be reproduced with an ISBN that has an invalid prefix, group code or publisher code. An example ISBN would be "0788893777 (2 DVD 45th ed)". When attempting to look up a record with such an ISBN, you will get an error along the lines of: Can't call method "as_string" on an undefined value Instead of checking for the BAD_ISBN state, we should be checking for the GOOD_ISBN state vi the method is_valid. Test Plan: 1) Edit a record, add the following ISBN to your record: 0788893777 (2 DVD 45th ed) 2) When Koha redirects to the record, you should see the error message described 3) Apply this patch 4) Reload the page, you should now see your record
Created attachment 28233 [details] [review] Bug 12243 - Records with invalid ISBNs can cause searches to fail Some types of invalid ISBNs, when run throught C4::Koha::NormalizeISBN can produce ISBN objects that contain invalid ISBNs. This can be reproduced with an ISBN that has an invalid prefix, group code or publisher code. An example ISBN would be "0788893777 (2 DVD 45th ed)". When attempting to look up a record with such an ISBN, you will get an error along the lines of: Can't call method "as_string" on an undefined value Instead of checking for the BAD_ISBN state, we should be checking for the GOOD_ISBN state vi the method is_valid. Test Plan: 1) Edit a record, add the following ISBN to your record: 0788893777 (2 DVD 45th ed) 2) When Koha redirects to the record, you should see the error message described 3) Apply this patch 4) Reload the page, you should now see your record Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 28244 [details] [review] Bug 12243 - Records with invalid ISBNs can cause searches to fail Some types of invalid ISBNs, when run throught C4::Koha::NormalizeISBN can produce ISBN objects that contain invalid ISBNs. This can be reproduced with an ISBN that has an invalid prefix, group code or publisher code. An example ISBN would be "0788893777 (2 DVD 45th ed)". When attempting to look up a record with such an ISBN, you will get an error along the lines of: Can't call method "as_string" on an undefined value Instead of checking for the BAD_ISBN state, we should be checking for the GOOD_ISBN state vi the method is_valid. Test Plan: 1) Edit a record, add the following ISBN to your record: 0788893777 (2 DVD 45th ed) 2) When Koha redirects to the record, you should see the error message described 3) Apply this patch 4) Reload the page, you should now see your record Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master. Thanks, Kyle!