summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Bridge.php5
-rw-r--r--src/forum_post_delete.php10
2 files changed, 10 insertions, 5 deletions
diff --git a/src/Bridge.php b/src/Bridge.php
index 3b3ed51..ce1d7d8 100644
--- a/src/Bridge.php
+++ b/src/Bridge.php
@@ -133,10 +133,7 @@ class Bridge {
$count = $this->db->exec($sql);
-# FIXME: throwing an exception prevents us from deleting old posts
- if ($count < 1) {
- throw new Exception('Failed to delete post id: ' . $postId);
- }
+ return $count > 0;
}
protected function get_exactly_one_row($sql) {
diff --git a/src/forum_post_delete.php b/src/forum_post_delete.php
index 177d08e..56fbfdc 100644
--- a/src/forum_post_delete.php
+++ b/src/forum_post_delete.php
@@ -14,10 +14,18 @@ catch (Exception $e) {
}
function remove_post($postId) {
+ require_once('Log.php');
+ $logger = &Log::singleton('file', '/var/log/listbridge', 'one');
+
require_once(__DIR__ . '/Bridge.php');
$bridge = new Bridge();
- $bridge->removePost($postId);
+ if ($bridge->removePost($postId)) {
+ $logger->info($postId . ' deleted');
+ }
+ else {
+ $logger->info($postId . ' not found, not deleted');
+ }
}
?>