Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
install system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2009 at 18:28 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent
Comments
Comment #1
joachim commentedHaving to use hook_requirements() to check dependencies is a faff. It's also a violation of DRY. Once a dependency is set in the .info file, it should be possible to trust that Drupal enforces this and not need to check for the existence of it ever again (unless you have weird requirements like specific versions). I'd call this a bug.
Comment #2
threexk commentedsubscribe. I am trying to create a CCK content type programmatically in my module at install, but this fails if several CCK modules are not installed even if they're listed as dependencies.
I agree with the bug categorization: the reasonable expectation is that a dependency will be available to a dependent module before any of its code runs. Thanks for the workaround, Greg.Harvey.
Comment #3
berdirCan you still reproduce this with latest HEAD? There were quite a few changes how dependencies are handled when installing modules.
Comment #4
greg.harveyI guess that falls to me - I'll need to port the code in that blog post to Drupal 7 and report back.
Comment #5
David_Rothstein commentedIn Drupal 7, this doesn't seem to be an issue when installing a module on an existing site. However, I can reproduce the problem when installing Drupal itself; I think the modules are installed in the order they are listed in the install profile's .info file, regardless of any dependencies. So things can break unless the profile author makes sure to list the modules in a special order.
I thought there was another issue for this somewhere, but can't find it at the moment (#731944: Module dependencies not considered during Installation Profile installation may be related).
Comment #6
greg.harveyThanks for the update. Unassigning myself... =)
Comment #7
valk commentedI had the same problem.
Looks like dependencies don't count in relation to modules install order.
My solution was to move the code to hook_enable().
I realize that this is not a solution, but hope this can help others.
Comment #8
David_Rothstein commentedI think the remaining issues here were fixed with #833192: Installer might install modules in wrong order - please feel free to reopen if not.
Comment #9
greg.harveyYay! That rocks! =)
Comment #10
threexk commentedThis issue originally for D6. Hoping for a patch backport in http://drupal.org/node/833192.