From 6f695083c03cce9fa30ed771f8c9c562715286b6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Aug 2014 13:42:35 +0200 Subject: [PATCH] Bug 12792: C4::Reserves breaks my vim syntax color C4/Reserves.pm is unreadable with my vim configuration. It appears I am the only one having this problem. For an incomprehensible reason, a string constructs with qq/my string/; completely breaks the syntax color for all the rest of the file (~2300l). If I replace it with qq{my string}; all is fine! Test plan: launch git show HEAD and verify this patch won't break anything. Additionally, prove t/db_dependent/Reserve.t This will trigger the three functions that were modified. Signed-off-by: Mark Tompsett --- C4/Reserves.pm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 7a075a4..6cad205 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -179,26 +179,26 @@ sub AddReserve { # updates take place here if ( $fee > 0 ) { my $nextacctno = &getnextacctno( $borrowernumber ); - my $query = qq/ + my $query = qq{ INSERT INTO accountlines (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding) VALUES (?,?,now(),?,?,'Res',?) - /; + }; my $usth = $dbh->prepare($query); $usth->execute( $borrowernumber, $nextacctno, $fee, "Reserve Charge - $title", $fee ); } #if ($const eq 'a'){ - my $query = qq/ + my $query = qq{ INSERT INTO reserves (borrowernumber,biblionumber,reservedate,branchcode,constrainttype, priority,reservenotes,itemnumber,found,waitingdate,expirationdate) VALUES (?,?,?,?,?, ?,?,?,?,?,?) - /; + }; my $sth = $dbh->prepare($query); $sth->execute( $borrowernumber, $biblionumber, $resdate, $branch, @@ -237,12 +237,12 @@ sub AddReserve { #} ($const eq "o" || $const eq "e") or return; # FIXME: why not have a useful return value? - $query = qq/ + $query = qq{ INSERT INTO reserveconstraints (borrowernumber,biblionumber,reservedate,biblioitemnumber) VALUES (?,?,?,?) - /; + }; $sth = $dbh->prepare($query); # keep prepare outside the loop! foreach (@$bibitems) { $sth->execute($borrowernumber, $biblionumber, $resdate, $_); @@ -684,11 +684,11 @@ sub GetReserveFee { #check for issues; my $dbh = C4::Context->dbh; my $const = lc substr( $constraint, 0, 1 ); - my $query = qq/ + my $query = qq{ SELECT * FROM borrowers LEFT JOIN categories ON borrowers.categorycode = categories.categorycode WHERE borrowernumber = ? - /; + }; my $sth = $dbh->prepare($query); $sth->execute($borrowernumber); my $data = $sth->fetchrow_hashref; @@ -1835,7 +1835,7 @@ sub _Findgroupreserve { # TODO: consolidate at least the SELECT portion of the first 2 queries to a common $select var. # check for exact targetted match - my $item_level_target_query = qq/ + my $item_level_target_query = qq{ SELECT reserves.biblionumber AS biblionumber, reserves.borrowernumber AS borrowernumber, reserves.reservedate AS reservedate, @@ -1857,7 +1857,7 @@ sub _Findgroupreserve { AND itemnumber = ? AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 - /; + }; my $sth = $dbh->prepare($item_level_target_query); $sth->execute($itemnumber, $lookahead||0); my @results; @@ -1867,7 +1867,7 @@ sub _Findgroupreserve { return @results if @results; # check for title-level targetted match - my $title_level_target_query = qq/ + my $title_level_target_query = qq{ SELECT reserves.biblionumber AS biblionumber, reserves.borrowernumber AS borrowernumber, reserves.reservedate AS reservedate, @@ -1889,7 +1889,7 @@ sub _Findgroupreserve { AND hold_fill_targets.itemnumber = ? AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 - /; + }; $sth = $dbh->prepare($title_level_target_query); $sth->execute($itemnumber, $lookahead||0); @results = (); @@ -1898,7 +1898,7 @@ sub _Findgroupreserve { } return @results if @results; - my $query = qq/ + my $query = qq{ SELECT reserves.biblionumber AS biblionumber, reserves.borrowernumber AS borrowernumber, reserves.reservedate AS reservedate, @@ -1922,7 +1922,7 @@ sub _Findgroupreserve { AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?) AND reserves.reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 - /; + }; $sth = $dbh->prepare($query); $sth->execute( $biblio, $bibitem, $itemnumber, $lookahead||0); @results = (); -- 1.7.9.5