Change user drop down to auto_complete

Bug #475013 reported by Michael Lustfield
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UD Planet
Fix Released
Wishlist
Michael Lustfield

Bug Description

The user selection should move from a drop down to an auto complete to ease the implementation in large environments.

Related branches

Changed in ubuntu-drupal-planet:
assignee: nobody → Michael Lustfield (mtecknology)
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This is implemented but not fully error checking in r41.

Revision history for this message
Pierre Buyle (mongolito404) wrote :

The User module provides a MENU_CALLBACK for user autocomplete.

In the form builder

$from['user'] = array(
      '#type' => 'textfield',
      '#title' => t('User'),
      '#autocomplete_path' => 'user/autocomplete',
      '#default_value' => isset($form_state['values']['user']) ? $form_state['values']['user'] : '',
      '#required' => TRUE,
);

In the form validation

$username = $form_state['values']['user'];
$user = user_load(array('name' => $username));
if(!$user) {
      form_set_error('dest', t('Unknown user %username', array('%username' => $username)));
}

The user_load has to be repeated in the submit handler.

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

Finished off in r42

Changed in ubuntu-drupal-planet:
status: In Progress → Fix Committed
Changed in ubuntu-drupal-planet:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.