Book module does not properly declare its dependencies. This leads to the following fatal errors when including it in an installation profile.
Reproduce error
Profile info file:
dependencies[] = block
dependencies[] = book
dependencies[] = dblog
Resulting error on install:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://localhost/rw/install.php?profile=myprofile&locale=en&id=1&op=do StatusText: OK ResponseText: Drupal @import url("http://localhost/rw/modules/system/system-behavior.css?0"); @import url("http://localhost/rw/modules/system/system.css?0"); @import url("http://localhost/rw/modules/system/system-messages.css?0"); @import url("http://localhost/rw/modules/system/system-menus.css?0"); @import url("http://localhost/rw/modules/user/user.css?0"); @import url("http://localhost/rw/themes/seven/reset.css?0"); @import url("http://localhost/rw/themes/seven/style.css?0"); Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure siteFinished Attempt to create a field of unknown type text_with_summary.
Profile info file:
dependencies[] = book
dependencies[] = block
dependencies[] = dblog
Resulting error on install:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://localhost/rw/install.php?profile=myprofile&locale=en&op=start&id=1&id=1&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function field_attach_create_bundle() in /opt/local/apache2/htdocs/rw/modules/node/node.module on line 539 Call Stack: 0.0001 65012 1. {main}() /opt/local/apache2/htdocs/rw/install.php:0 0.0002 72940 2. install_drupal() /opt/local/apache2/htdocs/rw/install.php:21 0.0368 1001940 3. install_run_tasks() /opt/local/apache2/htdocs/rw/includes/install.core.inc:80 0.1688 1350220 4. install_run_task() /opt/local/apache2/htdocs/rw/includes/install.core.inc:344 0.1689 1351648 5. _batch_page() /opt/local/apache2/htdocs/rw/includes/install.core.inc:454 0.1694 1352860 6. _batch_do() /opt/local/apache2/htdocs/rw/includes/batch.inc:81 0.1694 1353148 7. _batch_process() /opt/local/apache2/htdocs/rw/includes/batch.inc:163 0.7050 1768960 8. call_user_func_array() /opt/local/apache2/htdocs/rw/includes/batch.inc:286 0.7050 1768960 9. _install_module_batch() /opt/local/apache2/htdocs/rw/includes/batch.inc:0 0.7050 1769148 10. module_enable() /opt/local/apache2/htdocs/rw/includes/install.core.inc:1529 0.8290 1781056 11. module_invoke() /opt/local/apache2/htdocs/rw/includes/module.inc:407 0.8290 1781304 12. call_user_func_array() /opt/local/apache2/htdocs/rw/includes/module.inc:728 0.8290 1781304 13. book_install() /opt/local/apache2/htdocs/rw/includes/module.inc:0 0.8290 1781304 14. _book_install_type_create() /opt/local/apache2/htdocs/rw/modules/book/book.install:14 0.8291 1781572 15. node_type_save() /opt/local/apache2/htdocs/rw/modules/book/book.install:41
Patch coming.
Comments
Comment #1
alex_b commentedThis patch solves the errors reported above.
Comment #2
webchickLast I checked (seconds ago ;)), field and text were both required modules. So there's something messed up elsewhere; it shouldn't be required for modules to list individually required modules as dependencies. If this was the case, we'd have to add node as well.
Comment #3
webchickAlso, sorry, we're not holding up the release of Drupal 7 on book module. :P
Comment #4
alex_b commentedOk, this is a problem with the installation system then. It looks like required modules are not necessarily installed before other modules, leading to the book module installed before field and text.
I'd appreciate pointers as to where in install.core.inc I should start reading up.
Comment #5
alex_b commentedOur comments just crossed - I do think this is a release blocker as this points to a larger problem that effectively breaks installation profiles.
Comment #6
moshe weitzman commented#833192: Installer might install modules in wrong order sounds like it would have fixed this but apparently not.
Comment #7
damien tournoud commentedThe modules are installed in the correct order, but the notion of "required" module is not taken into account.
Comment #8
damien tournoud commentedI see three options here:
The first two options feels unnatural and break our nice dependency system. I'm leaning toward option 3.
Comment #9
chx commentedIt's not even a question. add an install_required_modules to install_tasks before install_profile_modules and after install_bootstrap_full . given how few there are , u do not necessarily need to batch it, even.
Comment #10
chx commentedThe required modules are in no way part of the dependency system. They are not displayed on the module pages for any modules that depend on them, they can never be disabled, if you ever write an app that disables a module and all the modules that were enabled only for that one then the required modules are not part of it again. And so 1. and 2. in #8 makes absolutely no sense.
And 3. is not exactly right, we need to do something, for that something see above.
Comment #11
chx commentedIn fact, #2 gave me an idea, not sure whether this is what Damien wanted but it does the job.
Comment #12
damien tournoud commentedMaybe this?
Comment #13
chx commentedthat was another patch.
Comment #14
damien tournoud commentedSlight better one.
Comment #15
chx commentedTotally works for me.
Comment #17
chx commentedThe install profile module needs to be last or at least after its dependencies but that'll resolve to last. With the patch above it came before the non-required dependencies. It's only a problem for install profiles because other required modules are 'real' required modules that dont depend on non-required modules.
Comment #18
alex_b commentedThis works now. Issues reported initially are fixed.
Comment #19
alex_b commentedJust found a problem a dependency does not get installed as expected. devel depends on menu, I included devel in my installation profile, but not menu. That should not matter as dependency checking should detect menu and install it before devel is installed. Nevertheless, menu doesn't get installed and I get this error: "Call to undefined function menu_save() in ../devel.install"
I am now taking a look at whether and why the dependency tree is not formed right.
Comment #20
chx commentedThat's a whole different issue, you know. But, it's here to fix.
Comment #21
chx commentedOoopsie left in devel in minimal :)
Comment #22
alex_b commentedThis works now, excellent.
Comment #23
moshe weitzman commentedYup. This fixed #897002: Testing profile skips required modules. +1
Comment #24
webchickAwesome work, folks! I think that's record time between identifying and closing a critical (fingers crossed ;)).
Committed to HEAD. Thanks!!