ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

remove Comments module

February 05, 2012 1:29pm

Subscribe [2]
  • #1 / Feb 05, 2012 1:29pm

    rmedek

    131 posts

    Can I remove (uninstall) the Comments module?

    There’s a link to do so in the Modules overview, which makes me think it’s possible. But if I do so, anything in the Control Panel that lists or sorts entries (like the Edit area) shuts down with a database error.

  • #2 / Feb 06, 2012 1:28pm

    Dan Decker

    7338 posts

    Hi rmedek,

    Indeed, you should be able to uninstall the Comments module without a problem.

    Do you have any entries that are marked to allow for comments? Have you ever made use of the comments module?

    What version of ExpressionEngine are you using? What is the error that you are seeing?

    Thanks!

  • #3 / Feb 06, 2012 1:48pm

    rmedek

    131 posts

    Do you have any entries that are marked to allow for comments?

    No…previously there were entries which allowed them, but only because the channel preferences were set to allow comments. I’ve since updated all channel preferences by selecting “no” under “Allow comments in this channel” and selecting “update all existing entries with this setting.”

    Have you ever made use of the comments module?

    In this website, no, other than the above.

    What version of ExpressionEngine are you using?

    2.4.0

    What is the error that you are seeing?

    When the Comments module is uninstalled, I see this message whenever I go to the Edit section:

    A Database Error Occurred
    Error Number: 1146

    Table ‘thinky_ee2.exp_comments’ doesn’t exist

    SELECT … (error changes here depending on which section I was trying to access)

    Filename: controllers/cp/content_edit.php

    Line Number: 332

    If I reinstall the module, the Edit section is restored, but then each channel has a “Date” tab restored where there previously wasn’t one, trying to display the comment expiration date, with these errors inserted:

    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 145
    ” id=“hold_field_
    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 145
    ” style=“width: 100%; “> 
    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 151
    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 152
    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 157
    ” class=“js_hide”>
    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 159

    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 166
    A PHP Error was encountered

    Severity: Notice
    Message: Undefined index: comment_expiration_date
    Filename: content/publish.php
    Line Number: 171

     

  • #4 / Feb 06, 2012 3:00pm

    rmedek

    131 posts

    If I reinstall the module, then toggle ALL channels to allow comments, then toggle them ALL back to disallow comments, the second errors go away. Uninstalling the Comments module then still gives the same error when trying to edit anything:

    A Database Error Occurred
    Error Number: 1146

    Table ‘thinky_ee2.exp_comments’ doesn’t exist

    SELECT `entry_id`, COUNT(*) as count FROM (`exp_comments`) WHERE `entry_id` IN …

    Filename: controllers/cp/content_edit.php

    Line Number: 332

  • #5 / Feb 06, 2012 4:39pm

    rmedek

    131 posts

    Okay, fixed by adding the check for comment module conditional around line 325.

    Changed from this:

    $show_link = TRUE;
    $comment_counts = array();
    
    if (count($entry_ids))
    {
     $comment_qry = $this->db->select('entry_id, COUNT(*) as count')
      ->where_in('entry_id', $entry_ids)
      ->group_by('entry_id')
      ->get('comments');
     
     foreach ($comment_qry->result() as $row)
     {
      $comment_counts[$row->entry_id] = $row->count;
     }
    }

    …to this:

    if ( isset($this->installed_modules['comment']) )
    {
     $show_link = TRUE;
     $comment_counts = array();
     
     if (count($entry_ids))
     {
      $comment_qry = $this->db->select('entry_id, COUNT(*) as count')
       ->where_in('entry_id', $entry_ids)
       ->group_by('entry_id')
       ->get('comments');
      
      foreach ($comment_qry->result() as $row)
      {
       $comment_counts[$row->entry_id] = $row->count;
      }
     }
    }

    So far no problems. Who do I send the invoice to?

  • #6 / Feb 08, 2012 6:35pm

    Shane Eckert

    7174 posts

    Hello,

    Thank you for using the ExpressionEngine forums!

    This is a [url=https://support.ellislab.com/bugs/detail/17380]known bug[/ur]. Well, it’s know now.

    Please feel free to comment on the bug to stay up to date on it’s progress. There is also a temporary fix listed. Similar to what you did! Nice detective work.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases