Bug 14472: (QA followup) fix updatedatabase.pl for multiple ISSN rules
authorTomas Cohen Arazi <tomascohen@unc.edu.ar>
Fri, 18 Sep 2015 15:34:45 +0000 (12:34 -0300)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Fri, 18 Sep 2015 15:39:07 +0000 (12:39 -0300)
If (for some reason) the user has created more than one matching rule
with the 'ISSN' code, the updatedabase.pl script fails, because it was
written with the default data in mind, and didn't consider the scenario
described above.

Thanks Liz for pointing this out!

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
installer/data/mysql/updatedatabase.pl

index caf4b4f..6d02ff1 100755 (executable)
@@ -10862,7 +10862,7 @@ if ( CheckVersion($DBversion) ) {
     $dbh->do(q{
         UPDATE matchpoints
         SET search_index='issn'
-        WHERE matcher_id=(SELECT matcher_id FROM marc_matchers WHERE code = 'ISSN')
+        WHERE matcher_id IN (SELECT matcher_id FROM marc_matchers WHERE code = 'ISSN')
     });
     print "Upgrade to $DBversion done (Bug 14472: Wrong ISSN search index in record matching rules)\n";
     SetVersion($DBversion);