I think this is a duplicate of this: http://drupal.org/node/158257

From clean install, I'm activating various modules, and I get the php error:

PHP Fatal error: Cannot redeclare class views_handler_field_username_comment in /var/www/test/drupal/modules/nodecomment/nodecomment.views.inc on line 186

Drupal 6.4, latest views, nodecomment

Thanks

Comments

drupypal’s picture

Hello,

Drupal 6.4;

nodecomment-6.x-1.2-rc1 views active and stable.

I just added these modules (at the same time);

- devel-6.x-1.10
- devel_forminspect-6.x-1.x-dev

As soon as i saved on the module page I got the same message:

Fatal error: Cannot redeclare class views_handler_field_username_comment in C:\xampp\htdocs\modules\nodecomment-6.x-1.2-rc1\nodecomment\nodecomment.views.inc on line 186

I hope this reproduction helps. Now I need to figure out how to unbork my system since I can't login. :)

drupypal’s picture

After some more research I found:
First off I am using node comment module in conjunction with Fivestar ratings to have an axes (rating through comments) rating system.
When I installed (devel-6.x-1.10 & devel_forminspect-6.x-1.x-dev) it is likely CCK comment was turned on (more testing needed) my rating nodes changed to regular comments instead of node comments (as far as I can tell), which produced this error.

To fix this I removed node comments, removed (devel-6.x-1.10 & devel_forminspect-6.x-1.x-dev), and deleted all nodes that were changed (my whole short database). After that I reinstalled node comments again and I am able to create nodes with the correct relationship.

I just found an easier reproduction case;

Enable Comment CCK (CCK Module) while Node Comment is active it appears to trigger the regular comment module (in Core Optional section, albeit grayed out), which causes the conflict.
More testing is needed, but at least this is a start to pin point and work around the conflict and a good reminder to always backup your drupal project before activating modules (duh).

I still need to test if I can convert regular comments back to Node Comments so I don't lose the node data when this error happens.

quicksketch’s picture

Category: bug » support
Status: Active » Closed (won't fix)

There's not much that can be done if another module is re-enabling the core comment.module without asking. Having both comment.module and nodecomment.module enabled will definitely cause all kinds of problems.

Important to note, the new 2.x version in the works is compatible with (and indeed requires) the core comment.module, so this will no longer be a problem with the new version.