Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I am using the profile generator as a help for writing an installation profile. I have some nodes I wish to input into the profile but when I use the code generated by this module, I get a fatal error 'Call to undefined function db_query()'
Am I perhaps missing something? I just copied the code from the generated profile that deals with inserting content. I also included the content types and the url aliasses.
Thanks in advance!
Comment | File | Size | Author |
---|---|---|---|
#5 | syclosubdomain.txt | 573.03 KB | msmethurst |
Comments
Comment #1
Shiny CreditAttribution: Shiny commentedAre you using the resulting code as a installation profile within the drupal installer?
Comment #2
AlfTheCat CreditAttribution: AlfTheCat commentedHi Shiny,
No I'm using it to generate the code for my own profile. I've just copied the entire section dealing with the implementation of my nodes.
Thanks!
Comment #3
Shiny CreditAttribution: Shiny commenteddb_query() is a function within drupal. If you run the code outside drupal it won't find that function.
Comment #4
AlfTheCat CreditAttribution: AlfTheCat commentedHi Shiny,
Thanks for that reply. Could you help me on interpreting it? If I run it inside an installation profile, how does that make that run outside of drupal? I just copied the code from the generated installation profile into another installation profile, based on the same website. If I understand your reply correctly, the code generated by the installation profile generator wouldn't work anyway?
Thanks again!
Comment #5
msmethurst CreditAttribution: msmethurst commentedI'm having this same problem.
I have generated an install profile using the tool.
Have then made a file and folder for the profile and put it into the profiles directory.
When I install and choose the generated profile, I get this error.
Call to undefined function db_query() ...... bootstrap.inc line 609
The code has worked before so I'm thinking its something happening as part of the .profile file being generated.
CHanged the file to .txt for upload purpose.
Comment #6
Shiny CreditAttribution: Shiny commentedCurious -- if you replace all instances of db_query with update_sql, does it work then?
Comment #7
AlfTheCat CreditAttribution: AlfTheCat commented@msmethurst did you find out if #6 from @Shiny worked?
Comment #8
lucidus_neil CreditAttribution: lucidus_neil commentedI did try replacing all of the db_query's with update_sql's to no avail. It would seem that the problem was before my profile actually called db_query. However, I was able to line by line check the modules that are included and determined that linkchecker module was causing the issue. Removed that module from my module install list and it worked!
Comment #9
Shiny CreditAttribution: Shiny commentedexcellent.
Comment #10
kinosura CreditAttribution: kinosura commentedThe same issue. After I include Link checker into the list of modules to enable, I get the above error during installation process.
Comment #11
hass CreditAttribution: hass commentedNo idea what this should have to do with linkchecker. You need to find out yourself.
Comment #12
hass CreditAttribution: hass commentedComment #13
BladeduSame issue here on d6. To reproduce the bug, create a new simple profile and add linkchecker module in the list of required module. Try to install a new drupal site with this profile and you'll get the error.
Comment #14
hass CreditAttribution: hass commentedAre you running pgsql?
Comment #15
BladeduNo, I'm using mysql.
Comment #16
hass CreditAttribution: hass commentedThis is a core function. I have no idea why it should be missing. You need to debug it to the source.
Comment #17
BladeduThe only way I found to solve the issue is to move the module from the required list to the optional one. Otherwise is always complaining about the db_query function.
Comment #18
hass CreditAttribution: hass commentedAs I know, only core modules are in the required list. Every other contrib modules are optional. I guess linkchecker is installed before core is ready. This cannot supported.