Needs review
Project:
DBTNG
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 Mar 2012 at 16:11 UTC
Updated:
7 Jan 2013 at 21:21 UTC
Jump to comment: Most recent file
PHP Fatal error: Class 'Database' not found in dbtng/dbtng.module on line 788 can occur if a module with a lower weight attempts to use dbtng database functions within hook_boot because the autoloader function for dbtng has not yet been registered. In particular, bakery does this and it causes a fatal error.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | dbtng-update_module_weight-1485646-1.patch | 577 bytes | pdrake |
Comments
Comment #1
pdrake commentedThis patch sets the module weight to -100 which matches the autoload module.
Comment #2
mikey_p commentedThanks, I'll try to roll this into the next release, should be taking place sometime within the next week or so (I'll be rsyncing with latest D7 code at the same time).
Comment #3
mikey_p commentedBTW, I'm really surprised to hear that Bakery is using this. I flipped through all the Bakery code on d.o and couldn't find any calls to DBTNG code, is that in special branch, or new patch?
Comment #4
pdrake commentedI should have been a little clearer - when bakery's hook_boot runs, if it needs to re-create the chocolate chip cookie, it ends up calling other functions, ultimately resulting in _menu_check_access being called. From there, any of a number of modules could end up using dbtng. In my specific case, the D6 og user access backport uses dbtng. Does that make sense?
Comment #5
marvil07 commentedI see this error on versioncontrol-6.x-2.x testbot results, i.e. http://qa.drupal.org/pifr/test/63108
Sadly, I can not reproduce it locally, but testbot consistently output this error on that branch.
It would be great to know if this can fix it.
Comment #6
marvil07 commentedThe error I mentioned is because of #1843018: Run hook_boot for installed modules on setUp(), and after reproducing locally, the patch does not fix it(my case which is not the original one, so leaving status).
Comment #7
apotek commentedIsn't the answer here to add all the necessary dbtng class files to the files[] array in dbtng.info?I was having trouble using db_or (Class not found) until I did this:+ files[] = database/query.incIgnore that. I just realized latest code no longer uses autoload.