diff options
author | Marius Halden <marius.h@lden.org> | 2018-05-29 19:37:34 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2018-05-29 19:37:34 +0200 |
commit | 782457d016084c8de04989dbc824a71899f8b41b (patch) | |
tree | 56d14e1a988396e43c8693ff3486e40d16962add /perllib/FixMyStreet/App/Controller/Rss.pm | |
parent | 140d40e3eab4cb1e7aa9f95cbc24a0f13180b606 (diff) | |
parent | 6e2da95bc6a758c0cf070b9ddd51acc769f7acf1 (diff) |
Merge tag 'v2.3.1' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 7cf4783c0..e1da4445d 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -282,14 +282,15 @@ sub add_row : Private { $item{pubDate} = $pubDate if $pubDate; $item{category} = encode_entities($row->{category}) if $row->{category}; - if ($c->cobrand->allow_photo_display($row) && $row->{photo}) { + if ((my $photo_to_show = $c->cobrand->allow_photo_display($row)) && $row->{photo}) { # Bit yucky as we don't have full objects here my $photoset = FixMyStreet::App::Model::PhotoSet->new({ db_data => $row->{photo} }); - my $first_fn = $photoset->get_id(0); + my $idx = $photo_to_show - 1; + my $first_fn = $photoset->get_id($idx); my ($hash, $format) = split /\./, $first_fn; my $cachebust = substr($hash, 0, 8); my $key = $alert_type->item_table eq 'comment' ? 'c/' : ''; - $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.0.$format?$cachebust\">"); + $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.$idx.$format?$cachebust\">"); } if ( $row->{used_map} ) { |