diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Moderate.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Moderate.pm b/perllib/FixMyStreet/App/Controller/Moderate.pm index bf70d52c5..b2bd3db3d 100644 --- a/perllib/FixMyStreet/App/Controller/Moderate.pm +++ b/perllib/FixMyStreet/App/Controller/Moderate.pm @@ -124,9 +124,9 @@ sub report_moderate_hide : Private { if ($c->req->param('problem_hide')) { - $problem->update({ state => 'hidden' }); + $c->res->redirect( '/' ); # Go directly to front-page $c->detach( 'report_moderate_audit', ['hide'] ); # break chain here. } } diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 526fbff90..3fae6860a 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -207,6 +207,8 @@ __PACKAGE__->has_many( # Schema::Loader, but that doesn't know about the problem_id mapping, so we now # (slightly hackishly) redefine here: # +# we also add cascade_delete, though this seems to be insufficient. +# # TODO: should add FK on moderation_original_data field for this, to get S::L to # pick up without hacks. @@ -216,7 +218,7 @@ __PACKAGE__->might_have( { "foreign.comment_id" => "self.id", "foreign.problem_id" => "self.problem_id", }, - { cascade_copy => 0, cascade_delete => 0 }, + { cascade_copy => 0, cascade_delete => 1 }, ); # we need the inline_constructor bit as we don't inherit from Moose |