Not finding site-specific modules

Events happening in the community are now at Drupal community events on www.drupal.org.
drm's picture

I've got a situation where the build/admin/modules list is not finding site-specific modules. The specific site is the original site in the setup and so the settings.php for this site is in site/default as well as site/www.specific.org. Initially the specific site didn't have its own site/specific.org folder because there were no other sites. Then I added other sites (which are working, but only use sites/all modules) and added some modules to the sites/www.specific.org folder and they aren't showing up.

I put some var_dump() calls in module.inc, specifically module_rebuild_cache and the modules in the specific folder are not being listed. It seems that the system module is simply not navigating through these folders to see the module files. The setup has separate databases for each site, but for this site, the settings.php file in site/default has the database info, so it doesn't need to see the settings.php in site/specific.

One other thing. My sites are set up via cpanel and I used an addon for the newer specific site, and cpanel lets me specify the root directory for addon domains, so I'm not using any links.

What could possibly be preventing the system from navigating these folders?

Comments

If the site is using the

Garrett Albright's picture

If the site is using the settings.php file in sites/default, it's not going to look for the modules in sites/specific/modules. It needs to use the settings.php in the specific directory. I'm a bit confused as to why it's not using it already, though, if it's really there and you're sure you've named your directories right.

Any site operated using sites/default/settings.php is only going to be able to see the non-core modules in sites/all/modules.

That was it

drm's picture

Garrett - You had it. I had a settings.php in both the all and the site-specific folder for the original site, and so it wasn't looking it the site-specific folder at all. By just removing the settings file in the sites/all/default folder, it's all working.

Thanks

Not Working for Me

tomsherlock's picture

I tried the same thing, removing the settings file from the sites/all/default folder. I still see only the core modules, no contrib.

Would permissions contribute to this problem?

The default directory should

Garrett Albright's picture

The default directory should be at sites/default, not sites/all/default. That might be confusing things.

default, not all

drm's picture

I meant 'default' in the march 10 post, not 'all'. It was a typo.

However the problem has returned for me. We moved our mutisite to a new host, and now I'm again not finding modules in sites/specific/modules, even though the settings.php file is not in default. Is there ever a reason to have a settings.php in the sites/default folder on a multisite? They should only be sites/specific/settings.php, right?

Odd thing is that the system table lists the modules, but the modules page does not show them. That means that the system module is finding them. I even set status to 1 in the systems table. I'm having some other off effects on db access with this specific site - in one module it's actually trying to use the database from the old host. But if it tried that overall, there would be no site to see. I don't see how it can save that database name for one module only. The database name is not in the query.

Is there ever a reason to

Garrett Albright's picture

Is there ever a reason to have a settings.php in the sites/default folder on a multisite?

I think it's a good idea to do so, just so there's a "fallback" if Drupal gets a hit for a URL which it can't otherwise handle yet. It may ultimately save you some headache as well. Just whatever the "main" site for your installation will be, use "default" for it.

For these modules you're having trouble with, try deactivating and uninstalling them (using the "uninstall" tab on the module list page), then making sure they're in the correct directory and reinstalling them. Keep in mind that it's generally a bad idea to move around modules once they're installed - upon installation, Drupal takes note of their locations and will look for them in that place when it tries to load them. If you must move a module, deactivate it first.

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: