Updating a form value from db_select results

I'm attempting to populate default values for a form from a database table. I've created the database select statements as shown below and want to assign the field values that are retrieved to different form attributes for the form field. I believe the db_select statement I wrote is at least syntactically correct, but I can't seem to figure out what the correct format/syntax is for the final step in assigning the db_select results to the form fields. I've only attempted the #default_value in the code below.

In the case below, I get the error message:

Notice: Undefined index: value_default in v01_fields() (line 60 [which is the #default_value line]

/** For the table v01fielddata, return three fields based on the submitted primary key (fieldid), v01price. */

function v01_v01fielddata_fetch () {
$query = db_select('v01fielddata')
->condition('fieldid', 'v01price')
->fields('v01fielddata', array('title_default', 'desc_default', 'value_default'));
$result = $query->execute();
variable_set('v01price_result', $result);
}

/**
* Input Form
*/

function v01_fields ($form, &$form_submit) {

$result = variable_get('v01price_result', array());

$form['v01_price'] = array (
'#title' => t('Vehicle purchase price'),
'#type' => 'textfield',
'#default_value' => $result['value_default'],

Hiring a Drupal 7 developer in North East UK

We're looking to hire a Drupal 7 backend developer to help work with a small team on a 4 month project.

Candidates must be able to work on-site for parts of the project and ideally have experience working with systems in e-commerce, events, file management and authentication.

If anyone is interested or knows of someone who would be, please get in touch via my contact form and include examples of work you've done in the past and anything else you feel may be relevant.

Thanks

Sub Users/Accounts

I am trying to create a site that will allow a user role of consultant to create subusers or accounts for which he could use to create orders for on their behalf. The site administrator should have access to see all the consultants and the sub accounts they have created where as a consultant should only see the users they have created and manage.

A consultant will be paid commission based on the number of orders he makes for his users so therefore it is important the administrator can filter users based on the consultant who created them.

Drupal & MoinMoin

Hello:

I am creating a portal with drupal and I need a drupal website with a forum and a wiki moinmoin.

I have the website with active forums, but I can not integrate the login access to MoinMoin.

I tried following this (http://moinmo.in/HelpOnAuthentication/DrupalAuth) but does not work:
- Disappears login in moinmoin
- When I login in the website drupal does not give me permission to do anything on the moinmoin.

Any suggestions?

Thank you very much

Alter the listing of menus in admin/structure/menu

Hello there, I read a lot of posts on how to alter forms/menus/nodes but I cannot find how to alter the listing of menus in admin/structure/menu. More specificly: I want to hide some menus for users in that admin page. But I'm also wondering if it is possible to alter admin pages, to hide specific elements (not on forms). It looks like theres no hook for that and - if I understand right - you need a hook to implement this. I read that I can also try to override the page with another function and then copy the menu functions to my own module, but I cannot get that to work.

Choose layout per teaser and department it is shown in

Does anyone have any examples of sites that have implemented a function to let editors choose between different layouts (and font size) per teaser? (and how did they do it?) The same article can be in multiple departments (and we are talking 500+ departments) at the same time. The layout is for a specific node, other node teasers in the same department have the same option of choosing a layout specific to it.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x