aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-01-12 15:28:15 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-01-12 15:28:15 +0000
commitde6df5e30d4801afc560e93c833a692a117b9547 (patch)
treed66e9958c7e976e779c0e23e88631bd9c5af777d /perllib/FixMyStreet/DB/Result/Problem.pm
parent0715183153048e2bdbf838d6206ae50103d50384 (diff)
Remove most passing of Catalyst to PhotoSet.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 237785820..745d88629 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -487,9 +487,8 @@ sub admin_url {
Returns a hashref of details of the attached photo, if any, for use in templates.
-NB: this method doesn't currently support multiple photos gracefully.
-
-Use get_photoset($c) instead to do the right thing with reports with 0, 1, or more photos.
+NB: this method only returns the first if there are multiple photos. Use
+get_photoset if you wish to access multiple photos.
=cut
@@ -858,18 +857,17 @@ sub latest_moderation_log_entry {
Return a PhotoSet object for all photos attached to this field
- my $photoset = $obj->get_photoset( $c );
+ my $photoset = $obj->get_photoset;
print $photoset->num_images;
return $photoset->get_image_data(num => 0, size => 'full');
=cut
sub get_photoset {
- my ($self, $c) = @_;
+ my ($self) = @_;
my $class = 'FixMyStreet::App::Model::PhotoSet';
eval "use $class";
return $class->new({
- c => $c,
db_data => $self->photo,
object => $self,
});