aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm4
-rw-r--r--perllib/FixMyStreet/App/View/Web.pm8
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm11
3 files changed, 19 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 4973b7c4e..424f68ba3 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -135,6 +135,9 @@ sub index : Path : Args(0) {
return 1;
}
+sub config_page : Path( 'config' ) : Args(0) {
+}
+
sub timeline : Path( 'timeline' ) : Args(0) {
my ($self, $c) = @_;
@@ -1164,6 +1167,7 @@ sub set_allowed_pages : Private {
'users' => [_('Users'), 5],
'flagged' => [_('Flagged'), 6],
'stats' => [_('Stats'), 6],
+ 'config' => [ undef, undef ],
'user_edit' => [undef, undef],
'body' => [undef, undef],
'body_edit' => [undef, undef],
diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm
index 8d3775ddc..e4aafe951 100644
--- a/perllib/FixMyStreet/App/View/Web.pm
+++ b/perllib/FixMyStreet/App/View/Web.pm
@@ -19,7 +19,7 @@ __PACKAGE__->config(
render_die => 1,
expose_methods => [
'loc', 'nget', 'tprintf', 'display_crosssell_advert', 'prettify_dt',
- 'add_links', 'version',
+ 'add_links', 'version', 'decode',
],
FILTERS => {
escape_js => \&escape_js,
@@ -181,5 +181,11 @@ sub version {
return "$file?$version_hash{$file}";
}
+sub decode {
+ my ( $self, $c, $text ) = @_;
+ utf8::decode($text) unless utf8::is_utf8($text);
+ return $text;
+}
+
1;
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index f14a29f56..4fa442608 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -388,9 +388,14 @@ sub check_for_errors {
$self->category(undef);
}
- if ( $self->bodies_str && $self->detail &&
- $self->bodies_str eq '2482' && length($self->detail) > 2000 ) {
- $errors{detail} = _('Reports are limited to 2000 characters in length. Please shorten your report');
+ if ( $self->bodies_str && $self->detail ) {
+ if ( $self->bodies_str eq '2482' && length($self->detail) > 2000 ) {
+ $errors{detail} = _('Reports are limited to 2000 characters in length. Please shorten your report');
+ }
+
+ if ( $self->bodies_str eq '2237' && length($self->detail) > 1700 ) {
+ $errors{detail} = _('Reports are limited to 1700 characters in length. Please shorten your report');
+ }
}
return \%errors;