From ec303bcbead982ff75b9cf1100697a00b117e30c 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. --- C4/Reserves.pm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index a98eed4..0d0a74b 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -176,26 +176,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, @@ -234,12 +234,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, $_); @@ -643,11 +643,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; @@ -1776,7 +1776,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, @@ -1798,7 +1798,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; @@ -1808,7 +1808,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, @@ -1830,7 +1830,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 = (); @@ -1839,7 +1839,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, @@ -1863,7 +1863,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 = (); -- 2.0.0.rc2