Posted by alex_b on August 31, 2010 at 5:30pm
6 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | install system |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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[] = dblogResulting 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[] = dblogResulting 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=... 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:41Patch coming.
Comments
#1
This patch solves the errors reported above.
#2
Last 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.
#3
Also, sorry, we're not holding up the release of Drupal 7 on book module. :P
#4
Ok, 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.
#5
Our comments just crossed - I do think this is a release blocker as this points to a larger problem that effectively breaks installation profiles.
#6
#833192: Installer might install modules in wrong order sounds like it would have fixed this but apparently not.
#7
The modules are installed in the correct order, but the notion of "required" module is not taken into account.
#8
I see three options here:
The first two options feels unnatural and break our nice dependency system. I'm leaning toward option 3.
#9
It'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.
#10
The 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.
#11
In fact, #2 gave me an idea, not sure whether this is what Damien wanted but it does the job.
#12
Maybe this?
#13
that was another patch.
#14
Slight better one.
#15
Totally works for me.
#16
The last submitted patch, 898654-required-modules.patch, failed testing.
#17
The 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.
#18
This works now. Issues reported initially are fixed.
#19
Just 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.
#20
That's a whole different issue, you know. But, it's here to fix.
#21
Ooopsie left in devel in minimal :)
#22
This works now, excellent.
#23
Yup. This fixed #897002: Testing profile skips required modules. +1
#24
Awesome work, folks! I think that's record time between identifying and closing a critical (fingers crossed ;)).
Committed to HEAD. Thanks!!
#25
Automatically closed -- issue fixed for 2 weeks with no activity.