Hi,

I've got the following error after copying OpenResort to the modules folder of my Drupal 6.6:
- PHP Fatal error: Call to undefined function user_access() in C:\WebSites\xxxx.com_kbj2qspunfarbdam\includes\menu.inc on line 449 -

I realized later OpenResort is for Drupal 5 so I just canceled OpenResort module from the modules folder but I still receive the same error message.
I tried to solve by re-creating the database, but the error is still there.

Can you help me?

Thanks a lot!
Andrea

Comments

cog.rusty’s picture

After removing that module, run update.php. Also try simply visiting the admin/build/modules page.

anedra’s picture

Thanks, but after running update.php (I navigated in my web browser to: http://www.bbeurialo.com/update.php), I get this error:
PHP Fatal error: Call to undefined function _system_theme_data() in C:\WebSites\bbeurialo.com_kbj2qspunfarbdam\includes\theme.inc on line 439

To visit admin/build/modules page I have to log in, but I can't...

I really don't know what to try...
Ant other suggestion?

Thanks a lot!

cog.rusty’s picture

These errors suggest a bigger problem of misplaced Drupal files. In the first post, the missing user_access() function should exist in the modules/user/user.module file. In the last post, the missing _system_theme_data() function should exist in the modules/system/system.module file.

Both these files, system.module and user.module, belong to "required" Drupal modules, which are not allowed to be disabled or moved to a different place.

If these files exist, are undamaged, readable by the web server, and in the right place, make sure that you don't have any backup copies of Drupal's files anywhere else under Drupal, because they may cause confusion.

Also take a look at the database, browse the "system" table and check if drupal's five required modules, system, node, user, block, filter, are all enabled (status=1) and have the correct path (modules/system, modules/node etc).

I doubt that the cause of the problem was the openresort module. That was probably a coincidence.

Sometimes a slip of the mouse on the FTP window is enough to cause chaos by moving a folder inside another folder, so keep away from the /modules and /themes directories and use only /sites/all/modules and /sites/all/themes.

anedra’s picture

Thanks again for the useful info.
I tried but no way, must be my poor knowledge of Drupal as well. I decided to re-install Drupal and re-create the site.
Thanks a lot again for your help.

cgdigitaltreats’s picture

Function http://api.drupal.org/api/function/user_access/6 is defined in modules/user/user.module (http://api.drupal.org/api/file/modules/user/user.module/6/source). Either this file is missing, or perhaps it was missing and as a result has been disabled in the {system} table in the DB. The value of status should be 1. Same goes for node.module which is where node_load lives, and also block, filter and system modules. Hopefully that will fix the form.inc error too.

cog.rusty - October 19, 2008 - 02:13
Was that an upgrade from Drupal 6.0?

"undefined function user_access()" means that Drupal
- either didn't find the user.module file at the place where it should be (under /modules/user/)
- or it couldn't read it (because it was damaged, or because its permissions were less than 644, or because the permissions of it directory were less that 755, or for some other reason).

The error message from update.php does not say that some code is wrong, it says that it received a wrong value.

Don't access your site with the updated Drupal files before running update.php. Upload again, make sure that the modules have been placed at the right directories, make sure that Drupal's directories have permissions at least 755, and run update.php again.

Thanks. Rusty Cog, You were rigtht for me. I had to do your fix and gdk said the same thing, being those modules were disabled.

I tried to update to 6.8 and ran into that user access problem.

First:
I had to turn back on the user module, set to 1 from 0. Also the user module somehow had 750 permissions, I changed it to 755.
The system module was disabled for me. I set it to 1 and the site came back alive. Thanks.

For others, load up phpmyadmin, log into your database, scroll down to where it says system. Look for your modules, and the status, 1 is on 0 is off.

I'm posting this on all the pages I found that people had this problem.

quarky42’s picture

I was upgrading my Drupal from a really old version to the current 6.22. So, I upgraded to the final 4.x version, then to the final 5.x version. That all went smoothly. Then when I tried to upgrade to the 6.22 version I see this problem...

I get the white screen of death. I had to enable the error display. Searching leads me to this site. I checked my phpmyadmin and fond that both my system and user were disabled! WTF? why would these modules get disabled during an upgrade? I think this is a MAJOR bug.

Thank you so much for posting this! I would have been lost.

Norsemanx’s picture

cog.rusty, i made the same ftp error by accidentally uploading a another module directory into the existing module directory. needless to say when i discovered that and removed that subdirectory the site crashed. after fixing the path to the modules in the sytem table (essentially replacing 'modules/modules/' with just 'modules/') in my sql database using phpadmin it resolved the error and the site is working as expected.

your thread text 'Sometimes a slip of the mouse on the FTP window is enough to cause chaos by moving a folder inside another folder' is what saved my day. i'm posting this response as i'm sure other users may/will make the same mistake someday.

tomfriedel’s picture

update system set status = 1 where name = 'system' ;
update system set status = 1 where name = 'block' ;
update system set status = 1 where name = 'color' ;
update system set status = 1 where name = 'comment' ;
update system set status = 1 where name = 'dblog' ;
update system set status = 1 where name = 'filter' ;
update system set status = 1 where name = 'help' ;
update system set status = 1 where name = 'menu' ;
update system set status = 1 where name = 'node' ;
update system set status = 1 where name = 'taxonomy' ;
update system set status = 1 where name = 'update' ;
update system set status = 1 where name = 'user' ;

Upgraded http://www.BirdPhotos.com from early 5.x to 6.20 and needed to do this, don't know why,