Fatal error: Call to undefined function user_access()

spider_silk_design

Joined: 2007-01-31
Posts: 6
Posted: Fri, 2007-09-28 21:44

I recently upgraded a Drupal site with Gallery (2.2) embedded to version 5.2, and everything seemed to be OK at first. But all of a sudden all the pages are displaying the following:

Fatal error: Call to undefined function user_access() in /[my web directory]/modules/gallery/gallery.module on line 14

They were all right 5 minutes ago and I have NO idea what I might have just done that could have caused this. I did not make any changes to the gallery module configuration between the point when the site was OK and when it suddenly was not. I don't think I made any significant changes to anything, but I must have done something...

I did a search for function user_access and it's defined in the user module. I definitely haven't done anything to that - I don't know what could have happened to it.

Does anyone have any idea what might have caused this?

 
spider_silk_design

Joined: 2007-01-31
Posts: 6
Posted: Fri, 2007-09-28 22:39

Looks like this wasn't necessarily a gallery module specific problem after all, even though that's the module it occurred in. I did a search through the whole Drupal site, and found dozens of people had gotten that error under all kinds of different circumstances, and one thing I saw mentioned was that sometimes it happens when the system table in the database somehow gets the paths to some of the modules set wrong.

So I checked with phpMyAdmin, and indeed -- all the core modules had somehow lost their directory names, so that they just said (for example) modules/user.module instead of modules/user/user.module. It was like they had been set back to their 4.7 paths or something. HOW, I have no idea. I did not do anything to the system table, so I have no idea how it happened.

When I initially went through and set them all back again, it still didn't work, which really confused me. Then I saw that the user module also had its status set to 0, though I don't think it's technically possible for that one to be turned off -- it's one of the required core modules. So I opened that record to edit it again -- and the status was set to 1 again, without my having changed it. I saved it, even though I hadn't done anything, the status stayed at 1, and now the site is fine.

Very weird... I'm thinking there's some kind of database corruption going on. Maybe I should have a chat with my web host.