This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Adapting from another module gives SQL error

Hoi!

I'm trying to adapt the moviereview module to a gamereview module, but for some reason, it fails when it's going to insert a review into the databse. It gives the following output:

warning: sprintf(): Too few arguments in /blah/includes/database.inc on line 154.
user error: Query was empty
query: in /blah/includes/database.mysql.inc on line 66.
warning: Cannot modify header information - headers already sent by (output started at /blah/includes/common.inc:384) in /blah/includes/common.inc on line 192.

So, apparently the SQL query is empty... this puzzles me, however, since all I've done in the migrating was to change every instance of "movie" to "game", including the sql table, css file and so on. (Everything is displayed correctly, also the preview when submitting a review).
Here is the gamereview insert function and the moviereview equivalent:

<?php
function gamereview_insert($node) {

db_query("INSERT INTO {gamereview} (nid, gametitle, release, cover, genre, language, media, price, rating, review, systemreq) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s')", $node->nid, $node->gametitle, $node->release, $node->cover, $node->genre, $node->language, $node->media, $node->price, $node->rating, $node->review, $node->systemreq);

$numlinks = count($node->gamelinks);
for ($i = 0; $i < $numlinks; $i++) {

Forms, callbacks, and handling

Hello,

I am working a custom node module to expose CiviCRM records to users on a website. The goal of the module is to set up a "campaign" node with a group from CiviCRM that my users will contact. I want to make the contact methods modular, so that people can write new modules to allow for new methods of contacting the targets (some examples: email to the targets with a sample letter, provide the target's phone number and log a phone call, provide a door-knocking list for canvassers, etc).

Q: Display $breadcrumb variable from within a block?

Is it possible to display the $breadcrumb variable from within a block? I have tried using the variable '$breadcrumb' in an existing block but nothing shows up. I guess this only works when called from page.tpl.php?

Any help would be greatly appreciated.

Thanks!

Aggregator2 cvs module does not generate blocks with 4.7 beta 5

I am the webmaster of an interactive news portal where aggregator2 is an integral module. I am trying to make the transition from Drupal 4.6.5 to 4.7 (the themes are so much better) but I can't until aggregator2 works with 4.7. There is not currently an official 4.7 version of aggregator2 released but the cvs version does have some edits to make it ready for 4.7. Right now, the agggregator2 module works well but it is not generating blocks with the titles of the feed items. Does anyone know how to fix this? Thanks!

Accessing the content of a form_select with multiple selections

Hello,

I have a simple question. In fact it is so simple that I am very surprised not to have found the answer anywhere in the forums. I just need to know how to get the result of a form_select when multiple selections are allowed.

Normally the answer would be $node->name_of_my_form_element but that doesn't make sense in this case because there must be multiple values. I tried $node->name_of_my_form_element[$i] as well, and this does not yield results.

Just one custom field type addition to profile.module?

I am new to drupal and php, and if there was relevant information to my question posted elsewhere in the forum I couldn't find it.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions