I am receiving many "Cannot redeclare" errors when trying to access admin pages. For example:

My account page gives: Fatal error: Cannot redeclare user_autocomplete() (previously declared in /var/www/site/subdomains/www/htdocs/modules/user/user.pages.inc:12) in /var/www/site/subdomains/www/htdocs/modules/xmlsitemap/user/user.pages.inc on line 22

Administer link gives: Fatal error: Cannot redeclare system_main_admin_page() (previously declared in /var/www/sites/subdomains/www/htdocs/modules/system/system.admin.inc:12) in /var/www/sites/subdomains/www/htdocs/modules/xmlsitemap/system/system.admin.inc on line 60

The system is up to date with the latest release and was working just fine. Now It just throws up errors!

Thanks,

Matt.

Comments

Josiah_R’s picture

The error means exactly what it says. You have the same function declared more than once in you modules. Maybe you copied one of the modules to another folder. Do a search to find whether the phrase "user_autocomplete" appears in the modules directory other than in the page directory. If I'm right and you have accidentally copied the function, don't feel bad. I have done the exact same thing.

sus’s picture

Status: Active » Closed (fixed)

Thanks Josiah, looks like i copied the whole module folder in to the xml sitemaps module folder! Duh!

kpapoor’s picture

Hello:

I was facing a similar issue and then realized that my drupal/modules had the same files as sites/all/modules. I deleted one of them, however, my site refused to work then. I copy pasted everything and left it as it is and then I started receiving these error messages again. Could you please help?

I am working with Drupal ver. 7.4