I created a module, and in its .info file, put this:

dependencies[] = field

This should be OK. I want my module to depend on the core field.module. Right?

But when I try to enable this module, it tells me I cannot because I don't have Field and Field SQL Storage. See attached screen shot.

Obviously I have both Field and Field SQL Storage enabled. They are required modules and as such are not shown on the page (at least not with current Drupal 7), but they're definitely enabled.

May be related to this issue: #293223: Roll back "Hide required core modules"

Comments

davyvdb’s picture

Priority: Critical » Normal

We've never needed to specify dependency on required modules (like node, ...). So I think you can fix this issue by removing the line in your info file.

field.info specifies dependencies[] = field_sql_storage though. So maybe for consistency it should be allowed that one can specify dependency on required modules.

So I think this should be handled but isn't critical?

jhodgdon’s picture

I realize that I could fix that issue by removing the line from my info file, and of course I did exactly that.

If we're not going to allow dependencies on required modules, we need to say that somewhere prominitently in the documentation. But I think that is the wrong way to go, because the list of which modules are required, which ones are hidden, and which ones are OK to turn on/off is not always obvious. Just because a module is hidden doesn't mean it's a required module necessarily, as these are controlled by two different flags in the .info file.

JacobSingh’s picture

StatusFileSize
new1.19 KB

Here is a patch which might address it:

JacobSingh’s picture

Status: Active » Needs review
catch’s picture

I ran into this on http://drupal.org/node/562694#comment-2778044

Patch is similar to the one I ended up incorporating on that issue, however it exposes another bug, which is that install profiles specify all their modules as dependencies. So if you install core with the standard install profile, suddenly you can't disable comment module because 'standard' depends on it. Not good, but as far as I'm concerned that's also a bug, which has been hidden by this one.

Status: Needs review » Needs work

The last submitted patch, 710974-hidden-module-dep.patch, failed testing.

jhodgdon’s picture

Those look like real test failures from that patch, as they're about settings on the module page I think?

JacobSingh’s picture

Perhaps something related to this:

if (!empty($form_state['storage'])) {
    return system_modules_confirm_form($files, $form_state['storage']);
  }

I don't know the tests well enough to say...

webchick’s picture

webchick’s picture

Status: Needs work » Closed (duplicate)