Jump to content

Comments Manager Module Error [Using/Uninstall] || Comments NOT working 2.7.2


_NameLess_
 Share

Recommended Posts

Hello, 

thanks for the help the other day. 

I continued to configure/code my page like I want it. Now i was going to add comments. 

I installed the Comments Manager Module under "processwire/module/edit?name=ProcessCommentsManager". 

It got installed and I can see the menuoption under "setup", called: Comments.

Problem: 

It does not matter what link I press. Everyone shows the following error. Even uninstalling shows this error. 

Page: /processwire/setup/comments/

Error: 

Fatal error: Class 'Comment' not found in /var/www/testsite/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module on line 80

I am using Processwire 2.7.2.

Is anyone here who can help me sorting this problem out?

Best regards

EDIT: I just realized that this might be the wrong section of the forum. If so, please move this thread. Thanks!

Link to comment
Share on other sites

Short Update: 

I debugged it to the best I can and I found out that the problem lies directly with the Comment Fieldtype. 
The module after install is not recognized as loaded.
To be precise: It is not listed under "installed modules" in the debug tools. 

It says it is installed though. 

So, as the required module is not loaded. It is of course not possible to load/find the Comment-class. 

I will try to look into it more but I think this might be the end for me as I don't know where modules are loaded.

Link to comment
Share on other sites

Hi @_NameLess_,

Not a great start, eh? :-) Welcome to the forums.

I am going to test in a minute but I have not seen this error before. It seems to me you installed the module on your own custom path? Is there a reason for that? i.e. you should let PW determine the path.

Is this a local install or remote? 

I'll test and get back to you

Link to comment
Share on other sites

And we are back...

I now recall I have seen this error before (when I was playing around with enhancing the Comments Manager). Yeah, the error is not very intuitive. ProcessCommentsManager should at least catch the error and give a more informative message. What is happening is this. In line #92, Comments manager is calling a constant from the Comment Class. The Comment Class is not a module but a .php file. It is loaded/required_once in FieldtypeComments.module line #22. So, unless you at created at least one field of type Comments, you will get that error. That field does not have even have to be added to a template yet for this to work. If such a field is present, it calls FieldtypeComments.module which in turn loads the Comment.php class and everything is fine and dandy. 

So, long story short, first create a field of type Comments before attempting to load ProcessCommentsManager. I would also file a request on GitHub for @ryan to consider catching the above error and returning a more meaningful error message for supersusers.

Edited by kongondo
  • Like 3
Link to comment
Share on other sites

Hello, I am reading this forum for quite a while now.. and try to stay and help where I can. But I have to learn it first. ;)

I tried your solution and IT WORKS! Many times a solution is much more simply than one is thinking. ;)

I am going to test in a minute but I have not seen this error before. It seems to me you installed the module on your own custom path? Is there a reason for that? i.e. you should let PW determine the path.

Normal installation. No custom path involved ;)

So, long story short, first create a field of type Comments before attempting to load ProcessCommentsManager. I would also file a request on GitHub for @ryan to consider catching the above error and returning a more meaningful error message for supersusers.

Thanks again!

I tried to dig up a few things and only found out that the "FieldtypeComments"-module is not loaded when looking via debug-tools -> modules. Therefore I assumed there is some error. 

Should I write this bug report or will you/ryan? 

Also maybe good to work on: If CommentsManager is installed, it is impossible to uninstall. And it is also impossible to uninstall the CommentsModule as CommentsManager is installed. 

=> You really need a field, to uninstall. I think install/uninstall should work without the needing of a field. 

Have a nice day!

  • 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

×
×
  • Create New...