aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-01 18:58:50 -0800
committerfriendica <info@friendica.com>2015-03-01 18:58:50 -0800
commitd83460cd2ae5216208a17154d7a9858a5a633b33 (patch)
tree176c65f8505947cd0a799bb9f69018b8b97e1195
parentbc1afbc7625cf5d9f6f785a6c5d3f31ac3dffd1e (diff)
downloadvolse-hubzilla-d83460cd2ae5216208a17154d7a9858a5a633b33.tar.gz
volse-hubzilla-d83460cd2ae5216208a17154d7a9858a5a633b33.tar.bz2
volse-hubzilla-d83460cd2ae5216208a17154d7a9858a5a633b33.zip
The never ending saga of parent = 0 bugs on Dreamhost.
-rwxr-xr-xinclude/items.php10
-rw-r--r--mod/ping.php2
2 files changed, 11 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index d6c6f5043..8f16d23c1 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2087,6 +2087,16 @@ function item_store($arr,$allow_exec = false) {
if($r) {
+ // in case item_store was killed before the parent's parent attribute got set,
+ // set it now. This happens with some regularity on Dreamhost. This will keep
+ // us from getting notifications for threads that exist but which we can't see.
+
+ if(($r[0]['mid'] === $r[0]['parent_mid']) && (! intval($r[0]['parent']))) {
+ q("update item set parent = id where id = %d",
+ intval($r[0]['id'])
+ );
+ }
+
if(comments_are_now_closed($r[0])) {
logger('item_store: comments closed');
$ret['message'] = 'Comments closed.';
diff --git a/mod/ping.php b/mod/ping.php
index f49789be5..001c5594d 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -287,7 +287,7 @@ function ping_init(&$a) {
$result[] = format_notification($item);
}
}
- logger('ping (network||home): ' . print_r($result, true), LOGGER_DATA);
+// logger('ping (network||home): ' . print_r($result, true), LOGGER_DATA);
echo json_encode(array('notify' => $result));
killme();
}