diff options
author | Brion Vibber <brion@pobox.com> | 2010-05-25 13:11:36 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-05-25 13:11:36 -0700 |
commit | e68d2c9015ca48890ba125e61c698160a1846a72 (patch) | |
tree | 89ca01d70b12e38935032b93ae829494525a47c3 /classes | |
parent | 95159112b2331ee832a4cf1e711cb8f1f0193c44 (diff) | |
parent | 3d4ce6f10b94d487e8eff89f689fba22327634f0 (diff) |
Merge branch 'master' of gitorious.org:statusnet/mainline
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index e173a2469..d85c8cd33 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -97,15 +97,20 @@ class Notice extends Memcached_DataObject // For auditing purposes, save a record that the notice // was deleted. - $deleted = new Deleted_notice(); + // @fixme we have some cases where things get re-run and so the + // insert fails. + $deleted = Deleted_notice::staticGet('id', $this->id); + if (!$deleted) { + $deleted = new Deleted_notice(); - $deleted->id = $this->id; - $deleted->profile_id = $this->profile_id; - $deleted->uri = $this->uri; - $deleted->created = $this->created; - $deleted->deleted = common_sql_now(); + $deleted->id = $this->id; + $deleted->profile_id = $this->profile_id; + $deleted->uri = $this->uri; + $deleted->created = $this->created; + $deleted->deleted = common_sql_now(); - $deleted->insert(); + $deleted->insert(); + } // Clear related records |