Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

IA Pages - find the correct IA regardless of letter casing in the URL #1392

Merged
merged 3 commits into from Jun 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/DDGC/Web/Controller/InstantAnswer.pm
Expand Up @@ -595,7 +595,7 @@ sub ia_base :Chained('base') :PathPart('view') :CaptureArgs(1) { # /ia/view/cal
my ( $self, $c, $answer_id ) = @_;

$c->stash->{ia_page} = "IAPage";
$c->stash->{ia} = $c->d->rs('InstantAnswer')->find({meta_id => $answer_id});
$c->stash->{ia} = $c->d->rs('InstantAnswer')->search( \[ 'LOWER(me.meta_id) = ?', ( lc($answer_id) ) ] )->one_row;
my $ia = $c->stash->{ia};

unless ($ia) {
Expand Down
2 changes: 2 additions & 0 deletions t/instant_answer_basics.t
Expand Up @@ -258,6 +258,8 @@ $mech->content_contains('test_ia');

$mech->get_ok('/ia/view/test_ia');
$mech->title_is('Test Ia'); # Title case filter
$mech->get_ok('/ia/view/TEst_Ia'); # make sure we still get the IA with different letter casing
$mech->title_is('Test Ia'); # is this the correct IA?

if ( -d $userpage_out ) {
remove_tree( $userpage_out );
Expand Down