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

a question about drupal_get_form

When I write my own module by using drupal_get_form to customize my form, I got a blank output. And furthermore, the example in here, http://api.drupal.org/api/HEAD/file/developer/topics/forms_api.html, didn't work for me neither. Do you know anything wrong with it? There is my code, I hope it would be something help.

db_next_id() vs AUTO_INCREMENT

I'm an experienced web developer new to drupal. I've mostly been looking at other modules to see how to drupal does things. While i'd like to use drupal conventions, often i see that there are easier or more efficient ways to do stuff. These are the kinds of questions that aren't so well documented and leave me wondering as to the optimal way in drupal.

Problem with hook_user

hi,
i added a new module that expand the user registration form.
I added 1 more field when $type = 'register' :

$form['Community'] = array('#type' => 'fieldset', '#title' => 'Community', '#weight' => 1);
$form['Community']['Credit Card'] = array('#type' => 'textfield',
'#title' => 'Credit Card',
'#default_value' => $edit['Credit Card'],
'#maxlength' => 255,
'#description' => 'Please enter your credit card number',
'#required' => false, );

Flash audio module not showing up on site

I've just installed Drupal 5 on my server and have been trying to produce a podcast site with an embedded flash player that's avaiable through the audio module. No matter which player I select from the admin screen, none show up on the page. In the log of the site, it states "Page Not Found for modules/audio/players/button.swf" and every player is the same. I don't know what else I'm missing. Do I need some kind of flash module for drupal? Please help! First time installing Drupal... Thanks...

$query->add_where("your_where_clause_here");

Here's my code to start with:

function finance_views_arguments()
{
  $arguments = array(
   'Finance: to_or_from' => array(
    "name" => "Finance: Transfers to or from node",
    "help" => "Displays just transfers that are to or from the current node",
    "handler" => "finance_handler_arg_to_or_from",
   ),
  );
  return $arguments;
}

And my handler:

function finance_handler_arg_to_or_from($op, &$query, $a1, $a2)
{
  if ($op == "summary")
  {
    $query->add_field("from");
    $query->add_groupby("node_transfer.from");
    $fieldinfo['field'] = "node_transfer.from";
    return $fieldinfo;
  }
  if ($op = "filter")
  {
//    $query->add_where("node_transfer.field_from_nid = '$arg'"); //<<<<THIS LINE BREAKS
    $query->add_where("n.type = '$arg'"); //<<<<THIS LINE BREAKS
  }
  if ($op = "link")
  {
    return l('todo','#');
  }
  if ($op = "title")
  {
    return $query;
  }
}

when I display the view with my argument code in it says

Fatal error: Call to a member function add_where() on a non-object in /home/...blah.../mymodule.module on line 292 [commented above]

I've been using and reading http://drupal.org/node/42609 and http://drupal.org/node/99566 to make this code. For example, I copied the code from one of the examples exactly, to see if I could get it to work:

<?php

form_get_errors()

Hi all,

I have built a custom module for Drupal, and bypassing forms API in some areas. However, I cannot find any pointers for how to catch errors and carry out error handling. Searching the api I came across:

http://api.drupal.org/api/5/function/form_get_error
http://api.drupal.org/api/5/function/form_get_errors

But I need examples of how to apply this within my module.

Pages

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