Guestbook Comments Lost, Please help
Permalink
In May I upgraded a client's site, C5, add-ons, along with any overrides. I noticed that with the upgrade, there were now two comment blocks appearing on blog pages instead of one. This maybe where I really messed up, but I went into page types and deleted the one I saw there. Then of course all existing comments disappeared. So I went back into page types and reverted to the earlier version, but this did not work. I searched the forum for answers, and it seemed somewhere between the latest version and 5.6.0.2 there was a bug that caused comments to disappear, so I went back through and re-upgraded making sure to include 5.6.0.2
This did not fix the issue either, and I have no idea what to do. I believe the comments are still on the database, how do I get them to show up again? Can I do this by making the current comment block call a certain ID?
You can see this issue here:http://katevrijmoet.com/main-menu-pages/blog/29-blogs-and-websites-... which shows no comments, even though in page list here:http://katevrijmoet.com/main-menu-pages/blog/... there were 5 comments for that post. New comments seem to be working of course, but anything before mid-May is gone.
This did not fix the issue either, and I have no idea what to do. I believe the comments are still on the database, how do I get them to show up again? Can I do this by making the current comment block call a certain ID?
You can see this issue here:http://katevrijmoet.com/main-menu-pages/blog/29-blogs-and-websites-... which shows no comments, even though in page list here:http://katevrijmoet.com/main-menu-pages/blog/... there were 5 comments for that post. New comments seem to be working of course, but anything before mid-May is gone.
Are you using Pro Blog? If so, perhaps you can contact the developer (click the 'Support' button on the Pro Blog marketplace page:http://www.concrete5.org/marketplace/addons/problog/)... for some insights on how to get the comments back.
Thanks hereNT for the info! I thought it would involve something like that. I may be able to figure it out now, and edit the database.
.....
mhawke, thanks. Yes, it is Problog, but I'm using an override for the page type template, so I'm pretty sure it's my mess to fix. I'll ask though.
.....
mhawke, thanks. Yes, it is Problog, but I'm using an override for the page type template, so I'm pretty sure it's my mess to fix. I'll ask though.
It's inherent in the Guestbook Block, not in the template or ProBlog, I think.
Shot in the dark... there is a Tweetmeme error on those pages. Is it possible that this JavaScript error is somehow killing the comments. Can you pull the Tweetmeme code? See attached screenshot
hereNT is correct (no surprise). I have been able to duplicate what you did to delete the original comments and I have been able to restore them into a new Comment block by editing the database and changing the bID and cID for each 'deleted' comment. This is easy for a single comment deleted from a single Comment block but in your case this will require you to know the bID of the deleted block and the cID of the page from which it was originally deleted and you will need to know the bID and cID of the block into which you wish to place that comment. I'm not sure how the sort order will be handled once they are placed into the new block. Yikes!
You could do something like this:
Though, if you have pages that _haven't_ been disconnected from the page type defaults, you'll get problems with that. At least, I think you will. You might want to grab a list of all the blog posts on the site, then loop over and do something like this:
Please note that I haven't actually tested this code. It may not work quite properly, and you'll have to do a bit more to get the pieces you need to run them on all the pages you need to. But hopefully it gets you pointed in the right direction.
$db = Loader::db(); $_cID = $cobj->getCollectionID(); $blocks = $cobj->getBlocks(); $q = "UPDATE btGuestBookEntries set bID = ? WHERE cID = ?" // or // $blocks = $cobj->getBlocks("Comments Area Name"); foreach($blocks as $block) { if($b->getBlockTypeHandle() == 'guestbook') { $bID = $b->getBlockID(); $v = array($bID, $cID); $db->query($q, $v); } }
Though, if you have pages that _haven't_ been disconnected from the page type defaults, you'll get problems with that. At least, I think you will. You might want to grab a list of all the blog posts on the site, then loop over and do something like this:
$aBlocks = $cobj->getBlocks("Comments"); foreach ($aBlocks as $block) { if ($block->getBlockTypeHandle() == "guestbook"){ $newBlock = $block->duplicate($cobj); $block->delete(); } }
Please note that I haven't actually tested this code. It may not work quite properly, and you'll have to do a bit more to get the pieces you need to run them on all the pages you need to. But hopefully it gets you pointed in the right direction.
Thanks again guys! I've been able to restore a comment by changing its bID in the database to the latest one used since the upgrade. Hopefully this will work with most of them.
The missing comments are now restored. What's odd however is that their dates all say they were made today, despite what's in the DB. *Shrug* I'm just glad they're back!
Many thanks.
Many thanks.
"supposedly" the commenting is getting overhauled in C5.7. There are two new conversation blocks for use that will likely be a marked improvement. And obviously ProBlog will be moving to those as soon as possible. Although, I thought about just writing a custom one....I need it to fire events anyway for something else. So maybe I will just do that.
ChadStrat
ChadStrat
Chad, Do you know if commenters will be able to post a url to their own sites? My client wants this feature, for the commenter's name to be a hyperlink, if they choose the option. I was going to try to write it myself, but I don't know PHP well.
I have same problem, the blog shows comments are there, but I have no idea where to find them or how to turn them back on again.
Please, can somebody help, I dont know code and Im struggling to piece the more complex stuff together.
Please, can somebody help, I dont know code and Im struggling to piece the more complex stuff together.
You'd probably have to do something like get the comment block, find it's bID, then update all comments with the cID that matches the current page to use the new bID.