Fatal error: Cannot redeclare class defaultcontent_condition in /opt/lampp/htdocs/sites/all/modules/contrib/defaultcontent/plugins/defaultcontent_condition.inc on line 57

I just noticed this recently. Not sure how long it's been there. Any clues?

Comments

donpwinston’s picture

It occurs whenever a cron job is run or I install a new module.

Jeffrey C.’s picture

Status: Active » Postponed (maintainer needs more info)

Can you confirm this problem exists on a fresh Drupal 7 install?

JakeRogers’s picture

It did NOT exist on the fresh install of 7.14, which I have been running for over 6 months. I run cron automatically @ 3 hours and I just noticed the last run was nearly 3 weeks ago...try to run and get the Fatal error message. Thanks for any help.
Edit: I just remembered that about the same time I began having problems sending private messages...I get AJAX HTTP error code 200...this error pops up as I am typing in recipients name, but if you close and finish typing, the message is sent ok. Perhaps the two are related????????
Jake

Jeffrey C.’s picture

Title: Fatal error » Fatal error due to conflict with other contributed modules
Status: Postponed (maintainer needs more info) » Postponed

This might be due to a conflict with some contributed modules. However, the highest priority is to resolve outstanding bugs that exist in a fresh install.

markhalliwell’s picture

Status: Postponed » Fixed

Fatal error: Cannot redeclare class means that the class has already been declared.

This means one of two things in Drupal: you have two of the same modules in your site's file structure and Drupal is attempting to load both of them or your database registry is corrupt.

Locations you should check for duplication:

  1. profiles/*/modules - Keep this version and remove the ones below
  2. sites/all/modules - If it doesn't exist in the profiles modules dir, keep this one.
  3. sites/*/modules - If it doesn't exist in either of the above locations, you may have a registry conflict somehow.

If you find an offending duplicate module, remove it. Your problem should go away then. If it doesn't, you may have to rebuild your database registry. Install and run the Registry Rebuild drush command to help remedy this issue if it persists.

donpwinston’s picture

The file defaultcontent_condition.inc was in two places:

modules/contrib/defaultcontent/plugins/defaultcontent_condition.inc

and

modules/contrib/defaultcontent/context/plugins/defaultcontent_condition.inc

I removed it from modules/contrib/defaultcontent/plugins and the problem went away. I could not remove it from the context/plugins folder becasue then the whole site crashed. It expected it to be there.

JakeRogers’s picture

Wow!!! Outstanding...Finally, after 3+ weeks. I also had 2 copies located in
1) modules/defaultcontent/plugins
and
2) modules/defaultcontent/context/plugins

Like don, I deleted the one in 1) above and cron runs fine...no fatal errors...no errors finding usernames!!
Thank you donpwinston for the help...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.