View | Details | Raw Unified | Return to bug 6554
Collapse All | Expand All

(-)a/members/member.pl (-2 / +1 lines)
Lines 197-199 $template->param( Link Here
197
            );
197
            );
198
198
199
output_html_with_http_headers $input, $cookie, $template->output;
199
output_html_with_http_headers $input, $cookie, $template->output;
200
- 
200
print $member;
201
--
202
C4/ItemType.pm    |    4 ++--
201
C4/ItemType.pm    |    4 ++--
203
C4/Search.pm      |    1 +
202
C4/Search.pm      |    1 +
204
C4/Templates.pm   |   16 +++++++++++++---
203
C4/Templates.pm   |   16 +++++++++++++---
205
members/member.pl |    2 +-
204
members/member.pl |    2 +-
206
4 files changed, 17 insertions(+), 6 deletions(-)
205
4 files changed, 17 insertions(+), 6 deletions(-)
(-)a/C4/ItemType.pm (-2 / +2 lines)
Lines 81-87 sub all { Link Here
81
    for ( @{$dbh->selectall_arrayref(
81
    for ( @{$dbh->selectall_arrayref(
82
        "SELECT * FROM itemtypes ORDER BY description", { Slice => {} })} )
82
        "SELECT * FROM itemtypes ORDER BY description", { Slice => {} })} )
83
    {
83
    {
84
        utf8::encode($_->{description});
84
        utf8::upgrade($_->{description});
85
        push @itypes, $class->new($_);
85
        push @itypes, $class->new($_);
86
    }
86
    }
87
    return @itypes;
87
    return @itypes;
Lines 105-111 sub get { Link Here
105
        "SELECT * FROM itemtypes WHERE itemtype = ?", undef, $itemtype
105
        "SELECT * FROM itemtypes WHERE itemtype = ?", undef, $itemtype
106
    );
106
    );
107
    if ( $data->{description} ) {
107
    if ( $data->{description} ) {
108
        utf8::encode($data->{description});
108
        utf8::upgrade($data->{description});
109
    }
109
    }
110
    return $class->new($data);
110
    return $class->new($data);
111
}
111
}
(-)a/C4/Search.pm (+1 lines)
Lines 574-579 sub getRecords { Link Here
574
                            {
574
                            {
575
575
576
# Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL
576
# Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL
577
								utf8::decode($one_facet);
577
                                my $facet_link_value = $one_facet;
578
                                my $facet_link_value = $one_facet;
578
                                $facet_link_value =~ s/[()!?¡¿؟]/ /g;
579
                                $facet_link_value =~ s/[()!?¡¿؟]/ /g;
579
580
(-)a/C4/Templates.pm (-3 / +13 lines)
Lines 124-130 sub output { Link Here
124
            utf8_hashref($vars->{$k});
124
            utf8_hashref($vars->{$k});
125
        }
125
        }
126
        else {
126
        else {
127
            utf8::encode($vars->{$k}) if utf8::is_utf8($vars->{$k});
127
			if(utf8::is_utf8($vars->{$k})){
128
				utf8::upgrade($vars->{$k});
129
			}
130
			else{
131
			## this should not be needed (ideally :-)
132
			## this is included because, somewhere the input
133
			## is not getting utf8-decoded 
134
				utf8::decode($vars->{$k});
135
			}
128
        }
136
        }
129
    }
137
    }
130
    my $data;
138
    my $data;
Lines 145-151 sub utf8_arrayref { Link Here
145
            utf8_hashref($element);
153
            utf8_hashref($element);
146
            next;
154
            next;
147
        }
155
        }
148
        utf8::encode($element) if utf8::is_utf8($element);
156
157
		utf8::upgrade($element) if utf8::is_utf8($element);
149
    }        
158
    }        
150
}         
159
}         
151
160
Lines 160-166 sub utf8_hashref { Link Here
160
            utf8_hashref($hashref->{$key});
169
            utf8_hashref($hashref->{$key});
161
            next;
170
            next;
162
        }
171
        }
163
        utf8::encode($hashref->{$key}) if utf8::is_utf8($hashref->{$key});
172
173
		utf8::upgrade($hashref->{$key}) if utf8::is_utf8($hashref->{$key});
164
    }
174
    }
165
}
175
}
166
        
176
        
(-)a/members/member.pl (-3 / +1 lines)
Lines 85-90 if ($AddPatronLists=~/code/){ Link Here
85
}  
85
}  
86
86
87
my $member=$input->param('member') || '';
87
my $member=$input->param('member') || '';
88
88
my $orderbyparams=$input->param('orderby') || '';
89
my $orderbyparams=$input->param('orderby') || '';
89
my @orderby;
90
my @orderby;
90
if ($orderbyparams){
91
if ($orderbyparams){
Lines 197-200 $template->param( Link Here
197
            );
198
            );
198
199
199
output_html_with_http_headers $input, $cookie, $template->output;
200
output_html_with_http_headers $input, $cookie, $template->output;
200
print $member;
201
- 
202
--
203
C4/Templates.pm   |    2 --
201
C4/Templates.pm   |    2 --
204
members/member.pl |    1 -
202
members/member.pl |    1 -
205
2 files changed, 0 insertions(+), 3 deletions(-)
203
2 files changed, 0 insertions(+), 3 deletions(-)
(-)a/C4/Templates.pm (-2 lines)
Lines 153-159 sub utf8_arrayref { Link Here
153
            utf8_hashref($element);
153
            utf8_hashref($element);
154
            next;
154
            next;
155
        }
155
        }
156
157
		utf8::upgrade($element) if utf8::is_utf8($element);
156
		utf8::upgrade($element) if utf8::is_utf8($element);
158
    }        
157
    }        
159
}         
158
}         
Lines 169-175 sub utf8_hashref { Link Here
169
            utf8_hashref($hashref->{$key});
168
            utf8_hashref($hashref->{$key});
170
            next;
169
            next;
171
        }
170
        }
172
173
		utf8::upgrade($hashref->{$key}) if utf8::is_utf8($hashref->{$key});
171
		utf8::upgrade($hashref->{$key}) if utf8::is_utf8($hashref->{$key});
174
    }
172
    }
175
}
173
}
(-)a/members/member.pl (-3 lines)
Lines 85-91 if ($AddPatronLists=~/code/){ Link Here
85
}  
85
}  
86
86
87
my $member=$input->param('member') || '';
87
my $member=$input->param('member') || '';
88
89
my $orderbyparams=$input->param('orderby') || '';
88
my $orderbyparams=$input->param('orderby') || '';
90
my @orderby;
89
my @orderby;
91
if ($orderbyparams){
90
if ($orderbyparams){
92
- 
93
--
94
C4/Members.pm     |    1 -
91
C4/Members.pm     |    1 -
95
C4/Search.pm      |    3 +--
92
C4/Search.pm      |    3 +--
96
C4/Templates.pm   |   10 +---------
93
C4/Templates.pm   |   10 +---------
97
members/member.pl |    3 +++
94
members/member.pl |    3 +++
98
4 files changed, 5 insertions(+), 12 deletions(-)
95
4 files changed, 5 insertions(+), 12 deletions(-)
(-)a/C4/Members.pm (-1 lines)
Lines 282-288 sub Search { Link Here
282
        $searchtype = "exact";
282
        $searchtype = "exact";
283
    }
283
    }
284
    $searchtype ||= "start_with";
284
    $searchtype ||= "start_with";
285
286
	return SearchInTable( "borrowers", $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype );
285
	return SearchInTable( "borrowers", $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype );
287
}
286
}
288
287
(-)a/C4/Search.pm (-2 / +1 lines)
Lines 1206-1212 sub parseQuery { Link Here
1206
                $query .= " #$modifier";
1206
                $query .= " #$modifier";
1207
            }
1207
            }
1208
        }
1208
        }
1209
1210
        $query_desc = $query;
1209
        $query_desc = $query;
1211
        $query_desc =~ s/\s+/ /g;
1210
        $query_desc =~ s/\s+/ /g;
1212
        if ( C4::Context->preference("QueryWeightFields") ) {
1211
        if ( C4::Context->preference("QueryWeightFields") ) {
Lines 1252-1258 sub buildQuery { Link Here
1252
1251
1253
    my $query_desc;
1252
    my $query_desc;
1254
    ( $operators, $operands, $indexes, $limits, $sort_by, $scan, $lang, $query_desc) = parseQuery($operators, $operands, $indexes, $limits, $sort_by, $scan, $lang);
1253
    ( $operators, $operands, $indexes, $limits, $sort_by, $scan, $lang, $query_desc) = parseQuery($operators, $operands, $indexes, $limits, $sort_by, $scan, $lang);
1255
1256
    # dereference
1254
    # dereference
1257
    my @operators = $operators ? @$operators : ();
1255
    my @operators = $operators ? @$operators : ();
1258
    my @indexes   = $indexes   ? @$indexes   : ();
1256
    my @indexes   = $indexes   ? @$indexes   : ();
Lines 1607-1612 sub buildQuery { Link Here
1607
        warn "LIMIT DESC:" . $limit_desc;
1605
        warn "LIMIT DESC:" . $limit_desc;
1608
        warn "---------\nLeave buildQuery\n---------";
1606
        warn "---------\nLeave buildQuery\n---------";
1609
    }
1607
    }
1608
	utf8::decode($query_desc);
1610
    return (
1609
    return (
1611
        undef,              $query, $simple_query, $query_cgi,
1610
        undef,              $query, $simple_query, $query_cgi,
1612
        $query_desc,        $limit, $limit_cgi,    $limit_desc,
1611
        $query_desc,        $limit, $limit_cgi,    $limit_desc,
(-)a/C4/Templates.pm (-9 / +1 lines)
Lines 124-138 sub output { Link Here
124
            utf8_hashref($vars->{$k});
124
            utf8_hashref($vars->{$k});
125
        }
125
        }
126
        else {
126
        else {
127
			if(utf8::is_utf8($vars->{$k})){
127
			utf8::upgrade($vars->{$k}) if utf8::is_utf8($vars->{$k});
128
				utf8::upgrade($vars->{$k});
129
			}
130
			else{
131
			## this should not be needed (ideally :-)
132
			## this is included because, somewhere the input
133
			## is not getting utf8-decoded 
134
				utf8::decode($vars->{$k});
135
			}
136
        }
128
        }
137
    }
129
    }
138
    my $data;
130
    my $data;
(-)a/members/member.pl (-2 / +3 lines)
Lines 49-54 my ($template, $loggedinuser, $cookie) Link Here
49
my $theme = $input->param('theme') || "default";
49
my $theme = $input->param('theme') || "default";
50
50
51
my $patron = $input->Vars;
51
my $patron = $input->Vars;
52
my $tmp_member = $patron->{member};
53
utf8::decode($tmp_member);
54
$patron->{member} = $tmp_member;
52
foreach (keys %$patron){
55
foreach (keys %$patron){
53
	delete $$patron{$_} unless($$patron{$_});
56
	delete $$patron{$_} unless($$patron{$_});
54
}
57
}
55
- 
56
--
57
C4/Templates.pm |    1 +
58
C4/Templates.pm |    1 +
58
1 files changed, 1 insertions(+), 0 deletions(-)
59
1 files changed, 1 insertions(+), 0 deletions(-)
(-)a/C4/Templates.pm (-2 / +1 lines)
Lines 62-67 sub new { Link Here
62
    my $template = Template->new(
62
    my $template = Template->new(
63
        {   EVAL_PERL    => 1,
63
        {   EVAL_PERL    => 1,
64
            ABSOLUTE     => 1,
64
            ABSOLUTE     => 1,
65
			ENCODING => 'utf8',
65
            PLUGIN_BASE => 'Koha::Template::Plugin',
66
            PLUGIN_BASE => 'Koha::Template::Plugin',
66
            COMPILE_EXT => C4::Context->config('template_cache_dir')?'.ttc':'',
67
            COMPILE_EXT => C4::Context->config('template_cache_dir')?'.ttc':'',
67
            COMPILE_DIR => C4::Context->config('template_cache_dir')?C4::Context->config('template_cache_dir'):'',,
68
            COMPILE_DIR => C4::Context->config('template_cache_dir')?C4::Context->config('template_cache_dir'):'',,
68
- 
69
--
70
C4/Members.pm |    1 +
69
C4/Members.pm |    1 +
71
1 files changed, 1 insertions(+), 0 deletions(-)
70
1 files changed, 1 insertions(+), 0 deletions(-)
(-)a/C4/Members.pm (-2 / +1 lines)
Lines 282-287 sub Search { Link Here
282
        $searchtype = "exact";
282
        $searchtype = "exact";
283
    }
283
    }
284
    $searchtype ||= "start_with";
284
    $searchtype ||= "start_with";
285
285
	return SearchInTable( "borrowers", $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype );
286
	return SearchInTable( "borrowers", $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype );
286
}
287
}
287
288
288
- 
289
--
290
opac/opac-search.pl |    2 +-
289
opac/opac-search.pl |    2 +-
291
1 files changed, 1 insertions(+), 1 deletions(-)
290
1 files changed, 1 insertions(+), 1 deletions(-)
(-)a/opac/opac-search.pl (-2 / +1 lines)
Lines 96-102 my $template_name; Link Here
96
my $template_type = 'basic';
96
my $template_type = 'basic';
97
my @params = $cgi->param("limit");
97
my @params = $cgi->param("limit");
98
98
99
100
my $format = $cgi->param("format") || '';
99
my $format = $cgi->param("format") || '';
101
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
100
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
102
if ($format =~ /(rss|atom|opensearchdescription)/) {
101
if ($format =~ /(rss|atom|opensearchdescription)/) {
Lines 395-400 $template->{VARS}->{querystring} = join(' ', @operands); Link Here
395
if ($operands[0] && !$operands[1]) {
394
if ($operands[0] && !$operands[1]) {
396
    my $ms_query = $operands[0];
395
    my $ms_query = $operands[0];
397
    $ms_query =~ s/ #\S+//;
396
    $ms_query =~ s/ #\S+//;
397
	utf8::decode($ms_query);
398
    $template->param(ms_value => $ms_query);
398
    $template->param(ms_value => $ms_query);
399
}
399
}
400
400
401
- 

Return to bug 6554