aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Rss.pm
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2011-08-01 19:24:40 +0200
committerPetter Reinholdtsen <pere@hungry.com>2011-08-01 19:24:40 +0200
commit9d23030bc3cfc114729e86c6ad23190f54f65d76 (patch)
tree29a74cdbc92c0f95d22ab54a8417b2de72b923b2 /perllib/FixMyStreet/App/Controller/Rss.pm
parentafc5be9a3b027222d94c8fdc72e176de4466e40b (diff)
Try to get Open311 GeoRSS output working.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index 78793d9c1..4a5b320ed 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -191,13 +191,16 @@ sub query_main : Private {
my ( $site_restriction, $site_id ) = $c->cobrand->site_restriction( $c->cobrand->extra_data );
# Only apply a site restriction if the alert uses the problem table
$site_restriction = '' unless $alert_type->item_table eq 'problem';
+ my $search_criteria = $c->stash->{search_criteria};
# FIXME Do this in a nicer way at some point in the future...
my $query = 'select * from ' . $alert_type->item_table . ' where '
. ($alert_type->head_table ? $alert_type->head_table . '_id=? and ' : '')
- . $alert_type->item_where . $site_restriction . ' order by '
- . $alert_type->item_order;
+ . $alert_type->item_where . $site_restriction .
+ . ($search_criteria ? "and $search_criteria" : '')
+ . ' order by ' . $alert_type->item_order;
my $rss_limit = mySociety::Config::get('RSS_LIMIT');
+ $rss_limit = $c->stash->{max_requests} if $c->stash->{max_requests};
$query .= " limit $rss_limit" unless $c->stash->{type} =~ /^all/;
my $q = $c->model('DB::Alert')->result_source->storage->dbh->prepare($query);