Bugzilla – Attachment 33351 Details for
Bug 12792
C4::Reserves breaks my vim syntax color
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 12792: C4::Reserves breaks my vim syntax color
SIGNED-OFF-Bug-12792-C4Reserves-breaks-my-vim-synt.patch (text/plain), 5.11 KB, created by
Mark Tompsett
on 2014-11-06 21:55:57 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 12792: C4::Reserves breaks my vim syntax color
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2014-11-06 21:55:57 UTC
Size:
5.11 KB
patch
obsolete
>From cb1c3a3abc6b6b8c322028046613bf8fb7a16a15 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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 <mtompset@hotmail.com> >--- > 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12792
:
31023
|
33268
|
33350
|
33351
|
33390