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!

CommentFileSizeAuthor
#5 syclosubdomain.txt573.03 KBmsmethurst
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shiny’s picture

Status: Active » Postponed (maintainer needs more info)

Are you using the resulting code as a installation profile within the drupal installer?

AlfTheCat’s picture

Hi 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!

Shiny’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

db_query() is a function within drupal. If you run the code outside drupal it won't find that function.

AlfTheCat’s picture

Hi 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!

msmethurst’s picture

FileSize
573.03 KB

I'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.

Shiny’s picture

Status: Closed (works as designed) » Active

Curious -- if you replace all instances of db_query with update_sql, does it work then?

AlfTheCat’s picture

@msmethurst did you find out if #6 from @Shiny worked?

lucidus_neil’s picture

I 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!

Shiny’s picture

Status: Active » Closed (fixed)

excellent.

kinosura’s picture

Project: Profile Generator » Link checker
Version: 6.x-1.2 » 6.x-2.4
Component: Miscellaneous » Code
Category: support » bug
Priority: Normal » Major
Status: Closed (fixed) » Needs work

The same issue. After I include Link checker into the list of modules to enable, I get the above error during installation process.

hass’s picture

Priority: Major » Normal
Status: Needs work » Postponed (maintainer needs more info)

No idea what this should have to do with linkchecker. You need to find out yourself.

hass’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Bladedu’s picture

Status: Closed (cannot reproduce) » Needs work

Same 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.

hass’s picture

Are you running pgsql?

Bladedu’s picture

No, I'm using mysql.

hass’s picture

This is a core function. I have no idea why it should be missing. You need to debug it to the source.

Bladedu’s picture

The 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.

hass’s picture

Category: bug » support
Status: Needs work » Fixed

As 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.