Add posting username to taxonomy list automatically

nicholas.alipaz - February 25, 2009 - 05:56
Project:Author Taxonomy
Version:6.x-1.7
Component:User interface
Category:feature request
Priority:normal
Assigned:Robbie Sternenberg
Status:closed
Description

I request the option to add the posting user's username to the author list automatically on opening the posting form.

#1

nicholas.alipaz - February 25, 2009 - 18:29

I have added a hook_form_alter(), in a module I made, to my posting form for the time being:

<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
  if (
$form_id == 'my_formid_node_form') {
    global
$user;
    if (!
$form['taxonomy']['tags']['8']['#default_value']) {
     
$form['taxonomy']['tags']['8']['#default_value'] = $user->name;
    }
  }
}
?>

Still, would be a nice feature to add.

EDIT: added a quick if statement (line 5) that checks to see whether the field is empty before filling it in. Otherwise it wipes out any old values one might have.

#2

Robbie Sternenberg - March 17, 2009 - 18:21
Assigned to:Anonymous» Robbie Sternenberg
Status:active» fixed

Added this feature. Thanks for the suggestion.

#3

nicholas.alipaz - March 18, 2009 - 01:47

thanks for the addition. I will grab the new version soon!

#4

System Message - April 1, 2009 - 01:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.