Jump to content

Uninstall ProcessCommentsModule fails


felic
 Share

Recommended Posts

Hi,

i installed the core module "Comments" (with all its dependencies) several weeks ago while PW was still on 2.6.x. Meanwhile i've updated PW to 2.7.1. Now i want to uninstall/remove that module. Which fails with a "class not found" error.

Error: Class 'Comment' not found (line 80 of /xxx/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module) 
// ProcessCommentsModule.module, line 80
public function init() {
parent::init();
  $this->statuses = array(
    Comment::statusApproved => $this->_('approved'),
    ...
  ); 
}

As this is a core module it is certainly not a good idea trying to remove this by hand. So, can anybody give some advice what to do to get this module in a "uninstalled" mode again?

Thx in advance.

Link to comment
Share on other sites

  • 2 months later...

As I don't know what post fits better I decided to post updates in mine. 

Link: https://processwire.com/talk/topic/12194-comments-manager-module-error-usinguninstall/

EDIT/UPDATE: 

If you just want to delete and not use this module, you can replace a few values in the .module file, uninstall it and revert the replaced stuff. 

File location: \wire\modules\Process\ProcessCommentsManager\ProcessCommentsManager.module

Comment::statusApproved => $this->_('approved'),
Comment::statusPending => $this->_('pending'),
Comment::statusSpam => $this->_('spam'),
Comment::statusDelete => $this->_('delete')

To the following: 

1 => $this->_('approved'),
0 => $this->_('pending'),
-2 => $this->_('spam'),
999 => $this->_('delete')

There are 3 more "Comment::statusDelete". Just replace them with 999 and you are good to go. 

After this, upload the changes. You can now uninstall the module. Afterwards, just revert the changes and upload again. 

Clarification for the values: The "Comment"-Class is located under: \wire\modules\Fieldtype\FieldtypeComments\Comment.php

There are constants declared. 

Have fun :)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

EDIT: 

Kongondo pointed out our mistake. The problem is that we don't have a field for comments yet. Therefore the error fires. 

To uninstall: 

1. Create a new field from the type "Comments". 

2. Uninstall CommentsManager

3. Delete Field created in 1... 

4. WIN ;) 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...