Hello all,

For some absurd reason, I placed drupal 6.12 in the sites/all/modules folder when I tried to update the drupal version. Now, though, when I try to take it out, I always get an error message and I can't even update to the newest version (what is it, drupal 6.14?). I cant even use some core modules like poll either. Are there any ideas on how to properly install drupal again?

Thanks,

Narsil351

Comments

dman’s picture

Your system has detected and started using modules from within that directory. They are now taking priority over the ones stored in the normal place, so removing them would kill things.

try this:

visit admin/build/modules
delete/remove the wrong directory
refresh admin/build/modules

That should self-repair the paths to the core modules.

Otherwise you'll have to attack the database and change the paths in the {system} table to the correct ones.

narsil351’s picture

What do you mean by remove? Do I remove the core directories, or just remove the drupal-6.12 directory?

dman’s picture

you said you'd put drupal 6.12 inside sites/all/modules. That's wrong. So remove it again.
I'd advise MOVING it to somewhere safe, outside of webroot just in case.

narsil351’s picture

I still have the same problem. It does not appear in admin/build/modules. If you mean remove the core modules, then I can try that. However, I do not feel comfortable changing the paths in the {system} table to the correct ones, because nobody I personally know and trust with my sql feels comfortable changing the paths.

Is there no other way?

Thanks,

narsil351

lion123’s picture

I have the same problem. I'm using Drupal 6.12 and there is "drupal-6.12.tar" folder in my "sites/all/modules" directory. I tried with deleting it, but it caused the site to break. Luckily I made a backup and now it's properly working.

What should I do? I need to get rid of that folder because it's making upgrade of Drupal core impossible for me (I tried around 10 times).

Thanks in advance

P.S. Advice with "admin/build/modules" isn't working, because there's no "drupal-6.12.tar" folder listed.

dman’s picture

You don't have to DO anything on the admin/build/modules page, you just have to be there, because loading it will cause the internal module registry to refresh and find the available paths.

Anyway, if you can't do that, you'll have to edit the database directly - see your 'system' table and manually edit the incorrect filepaths to the correct ones.

But really, I've fixed this error caused by renaming directories dozens of times just by visiting admin/build/modules - possibly admin/build/themes also. Not because I unpacked drupal inside itself, but just because I renamed or relotated some modules in use...

lion123’s picture

Nothing helped. I even changed paths in system table. When I do that, I can use the site, but I can't log in. When I point to www.example.com/user I get this error:

Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/drupal-6.12.tar/drupal/modules/user/user.pages.inc' (include_path='.;C:\server\php\pear\') in C:\server\htdocs\drupal\includes\menu.inc on line 346

dman’s picture

Ouch. Didn't see that coming. The menu router nowadays also keeps track of hardcoded paths where it expects to find include files. It used to be more context-sensitive, and therefore portable.
I'd expect that flushing the cache_menu would trigger a rebuild, which may help. But that's guessing, visiting admin/build/modules has always fixed enough problems for myself.

lion123’s picture

I flushed the cache_menu table, but it remained the same. My only idea is to search the database for "drupal-6.12.tar" and manually change all of these paths. Is that safe?

dman’s picture

can't be worse than what you've got.
Start with {menu_router}[file]

lion123’s picture

"Start with {menu_router}[file]"

Sry, but I don't understand that part.

My plan is:

1. delete all cached data from drupal interface
2. put site in maintenance mode
3. search for all wrong paths within menu router table and any other tables and change them

I believe the site will work after these steps but I'm wondering if there will be some effects that will show later. I wouldn't like to discover that something is wrong after few weeks, because it will be too late then to fix things. So, can I be sure that these steps won't break anything?

Thank you for your efforts.

dman’s picture

The problem that you've got right now is in the {menu_router} table, [file] column.
A quick replace there may fix the include error you reported. Not to say you may not find other errors after that.

I can't tell just how broken you may make things if you keep trying :-) , apart from to say again that it always seems to pull itself together automatically after you've successfully visited admin/build/modules and admin/build/themes once after renaming, removing or otherwise messing with your module/theme storage paths. On those two pages, a lot of introspection is done, caches are refreshed, old paths forgotten and real ones checked. I've not seen any long term troubles from that, and I've moved modules around between directories a lot.

lion123’s picture

I tried the easiest approach on localhost and it seems to be working. I opened my site's sql database with Notepad++ and replaced every "sites/all/modules/drupal-6.12.tar/drupal" with empty space to get paths like this "modules/..." (paths the way they should be in first place). Then I imported that database.

Everything seems to be fine, I have even ran an update without any problems, which was really great for me, considering that more than 10 previous efforts were unsuccessful. There was only a small conflict with Custom Breadcrumb module, which I have uninstalled, and will probably install it again when it reaches stable 6.2x version.

Do you think this procedure is good? Everything should work fine, right? :)

tommyent’s picture

Thank you lion123.

I somehow ended up with drupal-6.13 in the sites/all/modules directory.

I have done the exactly the same as above. I can not find anything wrong with it but am wondering if I should be concerned.

Thanks in advance.

ledelboy’s picture

Thank you Lion. You saved my day. One little tweak to your procedure. My database is quite large, so I did first a search for the culprit term and realized that only the tables cache, memory_router, system, variable and watchdog had the issue. I emptied watchdog, exported the others, dumped them and replaced with the edited ones. I am a fortunate mac user, and BBedit helped me to go seriously through all occurrences. After that I flushed everything. In my case I had a copy of the sites directory inside one of the modules folder. Don't ask me why. I killed it, and everything looks fine now. Cross my fingers.

ninizik’s picture

You can also use this SQL line:

UPDATE system SET filename = REPLACE (
filename,
'sites/all/modules/drupal-6.XX/modules/',
'modules/');

ahimsauzi’s picture

Just had to clean a similar issue. I ended up using ninizik solution for the initial path rewrite. and a modified one for the the {menu_router}[file] error. After that all is good!

The SQL call for the {menu_router}[file] is:

UPDATE menu_router SET file = REPLACE (
file,
'sites/all/modules/drupal-6.XX/modules/',
'modules/');

Thanks guys!