Results 1 to 2 of 2

Thread: News Comments in 2.8.0

  1. #1
    New user
    Join Date
    06-29-09.
    Posts
    13

    Default News Comments in 2.8.0

    Hello
    I updating my TL to version 2.8.0. Unfortunately, I noticed that the file database.sql in news module, there is no tl_news_comments table. Currently in this table have 1200 news comments. Is there any advice how to keep them?

  2. #2

    Default Re: News Comments in 2.8.0

    After uploading the new files, you need to update the dababase by install.php.
    Install.php will detect that you are upgrading from 2.7.x and automatically migrate the data into tl_comments.

    Here is the snippet in install.php handling the transition:

    Code:
    				// News comments
    				$objComment = $this->Database->execute("SELECT * FROM tl_news_comments");
    
    				while ($objComment->next())
    				{
    					$arrSet = $objComment->row();
    
    					$arrSet['source'] = 'tl_news';
    					$arrSet['parent'] = $arrSet['pid'];
    					unset($arrSet['id']);
    					unset($arrSet['pid']);
    
    					$this->Database->prepare("INSERT INTO tl_comments %s")->set($arrSet)->execute();
    				}
    
    				// Delete system/modules/news/Comments.php
    				$this->import('Files');
    				$this->Files->delete('system/modules/news/Comments.php');
    				$this->reload();
    Extensions: avatar, cron, dlstats, editarea, geshi, helpdesk, recall, rep_*, smhcheck.
    FAQ's - Documents - Tickets
    Please no help requests by PM, use the forum or ticket link above instead!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •