Bugzilla – Attachment 14234 Details for
Bug 9136
C4::Tags not Plack-compatible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9136: C4::Tags not Plack-compatible
Bug-9136-C4Tags-not-Plack-compatible.patch (text/plain), 2.69 KB, created by
Jonathan Druart
on 2012-12-21 15:04:41 UTC
(
hide
)
Description:
Bug 9136: C4::Tags not Plack-compatible
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-12-21 15:04:41 UTC
Size:
2.69 KB
patch
obsolete
>From 5d7d0c572ea7d57c0a9c0139e05f3fe914a8d109 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Fri, 23 Nov 2012 14:14:16 -0500 >Subject: [PATCH] Bug 9136: C4::Tags not Plack-compatible > >The three module-scoped variables $ext_dict, @fields, and $select_all >were preventing tagging code from working under Plack. I fixed this >by changing the latter two to compile-time constants, and declared the >first with "our $ext_dict;" > >To test (under Plack): >1) Try to create a tag before the patch is applied. Note that you get a > 500 error in the AJAX request. >2) Apply patch. >3) Repeat step (1), noticing that this time the tag is created and there > is no error. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Tags.pm | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/Tags.pm b/C4/Tags.pm >index d74dbf8..b6b319b 100644 >--- a/C4/Tags.pm >+++ b/C4/Tags.pm >@@ -26,9 +26,11 @@ use Exporter; > use C4::Context; > use C4::Debug; > #use Data::Dumper; >+use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created); >+use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM tags_all\n"; > > use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); >-use vars qw($ext_dict $select_all @fields); >+our $ext_dict; > > BEGIN { > $VERSION = 3.07.00.049; >@@ -70,8 +72,6 @@ More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG" > INIT { > $ext_dict and $Lingua::Ispell::path = $ext_dict; > $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n"; >- @fields = qw(tag_id borrowernumber biblionumber term language date_created); >- $select_all = "SELECT " . join(',',@fields) . "\n FROM tags_all\n"; > } > > sub get_filters { >@@ -181,7 +181,7 @@ sub delete_tag_rows_by_ids { > > sub get_tag_rows { > my $hash = shift || {}; >- my @ok_fields = @fields; >+ my @ok_fields = TAG_FIELDS; > push @ok_fields, 'limit'; # push the limit! :) > my $wheres; > my $limit = ""; >@@ -208,7 +208,7 @@ sub get_tag_rows { > push @exe_args, $hash->{$key}; > } > } >- my $query = $select_all . ($wheres||'') . $limit; >+ my $query = TAG_SELECT . ($wheres||'') . $limit; > $debug and print STDERR "get_tag_rows query:\n $query\n", > "get_tag_rows query args: ", join(',', @exe_args), "\n"; > my $sth = C4::Context->dbh->prepare($query); >@@ -491,7 +491,7 @@ sub add_tag_index { > > sub get_tag { # by tag_id > (@_) or return; >- my $sth = C4::Context->dbh->prepare("$select_all WHERE tag_id = ?"); >+ my $sth = C4::Context->dbh->prepare(TAG_SELECT . "WHERE tag_id = ?"); > $sth->execute(shift); > return $sth->fetchrow_hashref; > } >-- >1.7.10.4
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 9136
:
13653
|
13957
| 14234