Skip to content

Commit

Permalink
Fixed a couple of issues which caused data imports to notify changes …
Browse files Browse the repository at this point in the history
…for some unchanged reports on the admin "Import Reports" page
  • Loading branch information
annajayne committed Nov 21, 2024
1 parent d090f7a commit e4cc46c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Projects/TDoR/src/models/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,8 @@ function set_from_row($row)

if (isset($row['latitude']) )
{
$this->latitude = $row['latitude'];
$this->longitude = $row['longitude'];
$this->latitude = (double)$row['latitude'];
$this->longitude = (double)$row['longitude'];
}

$this->cause = stripslashes($row['cause']);
Expand Down
6 changes: 4 additions & 2 deletions Projects/TDoR/src/views/pages/admin/admin_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ public static function add_csv_items($csv_items, $reports_table, $temp_reports_t
*/
private static function report_contents_match($report1, $report2)
{
$delta = 1E-8;

if ( ($report1->name == $report2->name) &&
($report1->age == $report2->age) &&
($report1->photo_filename == $report2->photo_filename) &&
Expand All @@ -247,8 +249,8 @@ private static function report_contents_match($report1, $report2)
($report1->tdor_list_ref == $report2->tdor_list_ref) &&
($report1->location == $report2->location) &&
($report1->country == $report2->country) &&
($report1->latitude == $report2->latitude) &&
($report1->longitude == $report2->longitude) &&
(abs($report1->latitude - $report2->latitude) < $delta) &&
(abs($report1->longitude - $report2->longitude) < $delta) &&
($report1->cause == $report2->cause) &&
($report1->description == $report2->description) &&
($report1->tweet == $report2->tweet) &&
Expand Down

0 comments on commit e4cc46c

Please sign in to comment.