From cb1c3a3abc6b6b8c322028046613bf8fb7a16a15 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Aug 2014 13:42:35 +0200 Subject: [PATCH] [SIGNED OFF] 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/Reserves.t This will trigger the three functions that were modified. The prove currently fails on test 8, but the other succeeding tests prove that this change is fine. 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 032e044..6a78488 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; @@ -1865,7 +1865,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, @@ -1888,7 +1888,7 @@ sub _Findgroupreserve { AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 ORDER BY priority - /; + }; my $sth = $dbh->prepare($item_level_target_query); $sth->execute($itemnumber, $lookahead||0); my @results; @@ -1898,7 +1898,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, @@ -1921,7 +1921,7 @@ sub _Findgroupreserve { AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 ORDER BY priority - /; + }; $sth = $dbh->prepare($title_level_target_query); $sth->execute($itemnumber, $lookahead||0); @results = (); @@ -1930,7 +1930,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, @@ -1955,7 +1955,7 @@ sub _Findgroupreserve { AND reserves.reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 ORDER BY priority - /; + }; $sth = $dbh->prepare($query); $sth->execute( $biblio, $bibitem, $itemnumber, $lookahead||0); @results = (); -- 1.7.9.5