aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-03-11 16:48:32 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-03-12 11:56:07 +0000
commit25792b5e3bdebd3d1d13c370c4d6da0db3d38cef (patch)
tree0f3538580b6742de50ec162d67854df90e5d3e28 /perllib
parentc97eb13c2920103416c19ec526304fd07d44c386 (diff)
[Open311] Proper bodies check for sending updates.
Otherwise running on a site where one body ID is a substring of another, comments can get processed for the wrong body.
Diffstat (limited to 'perllib')
-rwxr-xr-xperllib/Open311/PostServiceRequestUpdates.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/perllib/Open311/PostServiceRequestUpdates.pm b/perllib/Open311/PostServiceRequestUpdates.pm
index e2172c028..c8ff2130f 100755
--- a/perllib/Open311/PostServiceRequestUpdates.pm
+++ b/perllib/Open311/PostServiceRequestUpdates.pm
@@ -52,18 +52,16 @@ sub process_body {
my $o = Open311->new( $self->open311_params($body) );
- my $comments = FixMyStreet::DB->resultset('Comment')->search( {
+ my $comments = FixMyStreet::DB->resultset('Comment')->to_body($body)->search( {
'me.whensent' => undef,
'me.external_id' => undef,
'me.state' => 'confirmed',
'me.confirmed' => { '!=' => undef },
'problem.whensent' => { '!=' => undef },
'problem.external_id' => { '!=' => undef },
- 'problem.bodies_str' => { -like => '%' . $body->id . '%' },
'problem.send_method_used' => { -like => '%Open311%' },
},
{
- join => 'problem',
order_by => [ 'confirmed', 'id' ],
}
);