diff options
-rwxr-xr-x | bin/import-flickr | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/import-flickr b/bin/import-flickr index 992a6ac8e..21ea5822a 100755 --- a/bin/import-flickr +++ b/bin/import-flickr @@ -72,19 +72,19 @@ while ($result =~ /<photo id="([^"]*)" owner="([^"]*)" secret="([^"]*)" server=" sub problem_create { my ($photo_id, $owner, $title, $lat, $lon, $image) = @_; my ($name, $email) = dbh()->selectrow_array("select name, email from partial_user where service='flickr' and nsid=?", {}, $owner); - my ($easting, $northing) = (0,0); + + # set some defaults $name ||= ''; - if ($lat && $lon) { - # XXX This appears to be going wrong :( - ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G'); - } + $lat ||= 0; + $lon ||= 0; + my $id = dbh()->selectrow_array("select nextval('problem_id_seq')"); Utils::workaround_pg_bytea("insert into problem - (id, postcode, easting, northing, title, detail, name, + (id, postcode, latitude, longitude, title, detail, name, email, phone, photo, state, used_map, anonymous, category, areas) values (?, '', ?, ?, ?, '', ?, ?, '', ?, 'partial', 't', 'f', '', '')", 7, - $id, $easting, $northing, $title, $name, $email, $image + $id, $latitude, $longitude, $title, $name, $email, $image ); dbh()->do('insert into flickr_imported (id, problem_id) values (?, ?)', {}, $photo_id, $id); |