Comment rot solved
I found the cause of comment rot. There was an old legacy setting that I didn't know what it did. It was among the last of the things to trace out in the code. I traced it out and found the offending code that was deleting comments and entry properties (status, userpic, etc) and removed it. Please let me know in THIS post if any NEW comment rot occurs after this post.
This has been a very very long and trying road and I want to thank all of you who have stuck it out here in spite of this major bug.
sub new_entry_cleanup_hack {
my ($u, $jitemid) = @_;
# sanitize input
$jitemid += 0;
return unless $jitemid;
my $ownerid = LJ::want_userid($u);
return unless $ownerid;
# delete logprops
$u->do("DELETE FROM logprop2 WHERE journalid=$ownerid AND jitemid=$jitemid");
# delete comments
my $ids = LJ::Talk::get_talk_data($u, 'L', $jitemid);
return unless ref $ids eq 'HASH' && %$ids;
my $list = join ',', map { $_+0 } keys %$ids;
$u->do("DELETE FROM talk2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
$u->do("DELETE FROM talktext2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
$u->do("DELETE FROM talkprop2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
}
</pre>
Edit: After looking at the code even more closely I am sure that this was the cause, I think we can call comment rot a closed issue. Now to getting to writing a mass icon uploader.
This has been a very very long and trying road and I want to thank all of you who have stuck it out here in spite of this major bug.
sub new_entry_cleanup_hack {
my ($u, $jitemid) = @_;
# sanitize input
$jitemid += 0;
return unless $jitemid;
my $ownerid = LJ::want_userid($u);
return unless $ownerid;
# delete logprops
$u->do("DELETE FROM logprop2 WHERE journalid=$ownerid AND jitemid=$jitemid");
# delete comments
my $ids = LJ::Talk::get_talk_data($u, 'L', $jitemid);
return unless ref $ids eq 'HASH' && %$ids;
my $list = join ',', map { $_+0 } keys %$ids;
$u->do("DELETE FROM talk2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
$u->do("DELETE FROM talktext2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
$u->do("DELETE FROM talkprop2 WHERE journalid=$ownerid AND jtalkid IN ($list)");
}
</pre>
Edit: After looking at the code even more closely I am sure that this was the cause, I think we can call comment rot a closed issue. Now to getting to writing a mass icon uploader.
Related to the multi-icon uploading, I would love to have a select/delete all button for those occasions when I want to completely clean out a journal's icons and start uploading from scratch. Clicking "delete" 100 times is a bit tedious.
https://addons.mozilla.org/en-US/firefo
https://addons.mozilla.org/en-US/firefo
https://addons.mozilla.org/en-US/firefo
I am using a computer on which I can't use firefox, so I can't remember which I use to recommend, but I think you'll find them an extremely convenient addition.