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

Insert NULL value

If i have a field in my table set to float (default value for an empty value is 0.00) and i want to insert a NULL value instead of the default value when an empty value is inserted.

When i leave one of my textboxes empty the sql tries to insert an empty string into that field but by default it will set to 0.00, i want to be able to check if the textbox is empty and if so, replace the node variable with the string value "NULL"

this is what i have but alas it does not work

new line with form API

Hello,

Is there a way to avoid new line after a form item?

I'd like to put a checkbox just before a textfield to let user define the visibility of the field by others. But I don't know how to do that. Putting form items inside a table would be a nice idea but I don't know if it's possible

Thanks a lot for any answer

Buddylist in 4.7

What is the current state of buddylists in 4.7? We're having problems. When there are multiple requests for a user, the first user on the list will always be the request that is accepted/denied, regardless of which user's request you choose to accept or deny. From this thread, I can see that things were corrected for 5.x, but I cannot find any information on this for 4.7.

Advice for new node type with an existing database

I have an existing database and tables that I'd like to "drupalize" (add comments, search, include references in other nodes, create custom views, etc). From what I can tell, I need to create a custom node type to include my tables/fields. If I was starting from scratch, I can clearly see how to do this after reading through the module development handbooks.

However, I expect to be getting a refresh of this database on a regular basis and need to come up with an appropriate strategy for populating the "drupal" nodes and associating them with the rows of the imported database. For example, once a month, I may be getting a new drop of the database, most of the data being the same, albeit with some changes to some of the columns and perhaps with a few more rows in the tables.

Is there a common pattern to doing this in drupal or are there some ways I could implement my module to make this easier?

Forms API question (form_alter)

Hi,

I've been working on a new site recently and one of the things that I want to do is to tear apart the user registration form and put it back together in different fieldsets. I'm using the profile module to handle the additional information. The code I've written looks like:

<?php
global $form_values;
switch($form_id) {
case 'user_register':
$newform = array();

$newform[user_registration_help] = $form['user_registration_help'];

$newform['account'] = $form['account'];
$newform['account']['#weight'] = -50;
$newform['account']['name'] = $form['account']['name'];
$newform['account']['name']['#weight'] = -50;
$newform['account']['search_fn'] = $form['Personal Information']['search_fn'];
$newform['account']['search_fn']['#weight'] = -49;
$newform['account']['mail'] = $form['account']['mail'];
$newform['account']['mail']['#weight'] = -48;
$newform['location'] = $form['Location'];
$newform['location']['#weight'] = -49;
$newform['additional'] = array(
'#type' => 'fieldset',
'#title' => t('Additional Information'),
);
$newform['additional']['#weight'] = -48;
$newform['additional']['search_age'] = $form['Personal Information']['search_age'];
$newform['additional']['search_website'] = $form['Personal Information']['search_website'];

Buddy-functions for OG (Organic Groups)

Wouldnt it be nice if groups could use the buddy-function to link to each other just like users can do?
Is it a big thing to change the OG script to work with groups too?
Any ideas?
Thanks in advance
Finn

Pages

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