X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Ffixup_conversations.php;h=80890fe98d8ec82fc07b95aa945dc18636b6d0db;hb=0ec07e9c651f747d93865f75b8631899a7d7f04d;hp=4cc6728d749008955b85f0cdc989445abfe4d2fd;hpb=c8b8f07af14ad2ce9d0c0267962dd3bbf6473a4b;p=quix0rs-gnu-social.git diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php index 4cc6728d74..80890fe98d 100755 --- a/scripts/fixup_conversations.php +++ b/scripts/fixup_conversations.php @@ -1,7 +1,7 @@ #!/usr/bin/env php query('select id, reply_to from notice where conversation is null'); +$notice = new Notice(); +$notice->query('select id, reply_to from notice where conversation is null'); -while ($nid->fetch()) { +while ($notice->fetch()) { $cid = null; - $notice = new Notice(); + $orig = clone($notice); - if (empty($nid->reply_to)) { - $cid = $nid->id; + if (empty($notice->reply_to)) { + $notice->conversation = $notice->id; } else { $reply = Notice::staticGet('id', $notice->reply_to); @@ -61,9 +61,7 @@ while ($nid->fetch()) { continue; } - $notice = null; $orig = null; - unset($notice); unset($orig); print ".\n";