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

How do I commit HEAD branch with files that are currently in DRUPAL-5 branch?

How do I commit HEAD branch with files that are currently in DRUPAL-5 branch?

How to use form validate hook/function?

I'm brand new to Drupal, but I've been making pretty decent on a module by reading through examples and the API documentation. However, I'm having an issue that form validation that I just cannot figure out. Basically, according to everything I've read, a form_name_validate function should automatically validate any forms named form_name (unless, of course, it's overridden). However, this isn't happening. Here's a snippet my code:

function ssh_page() {
$output = '';
$host_options = array(
'server1' => t('server1'),
'server2' => t('server2'),
);
$form['host_select'] = array(
'#type' => 'fieldset',
'#title' => t('SSH Server Selection'),
'#tree' => TRUE,
);
$form['host_select']['hostname'] = array(
'#type' => 'select',
'#title' => t('Hostname'),
'#default_value' => variable_get('hostname', ''),
'#options' => $host_options,
'#required' => TRUE,
'#description' => t('SSH Server name.'),
);
$form['host_select']['port'] = array(
'#type' => 'textfield',
'#title' => t('Port'),
'#default_value' => variable_get('port', '22'),
'#size' => 5,
'#maxlength' => '5',
'#required' => TRUE,
'#description' => t('SSH Server port.'),
);
$form['host_select']['submit'] = array(
'#type' => 'submit',
'#value' => t('Connect'),
);
$output = drupal_get_form('ssh_host_form', $form);

$node->path Not Available For Anonymous Users

You should use drupal_get_path_alias instead and remember to always test your modules and code as a anonymous user too.

anyone want to take over userreview project?

I have new assignment which precludes much Drupal development for a while. If anyone is interested in taking over the userreview module, please let me know.
Thanks
dado

how do I capture a number with 2 decimal places?

this number is defined as decimal(10,2) in mysql. it is declared like this in the form

   $form['cpm'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Cost per month'),
     '#default_value' => $node->cpm,
     '#maxlength'     => 6,
     '#required'      => FALSE,
     '#size'          => 6,
     '#weight'        => 3
   );

in validate, i have

Import Export Module Error

I've just installed the Import/Export module nad when I select it from the menu I get the following error:

Fatal error: Call to undefined function: form_select() in /home/southee/public_html/Drupal/modules/import_export/import_export.module on line 67

Any ideas what is causing this?

Cheers

Mark

Pages

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