Download & Extend

Add posting username to taxonomy list automatically

Project:Author Taxonomy
Version:6.x-1.8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

Comments

#1

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

Assigned to:Anonymous» Robbie Sternenberg
Status:active» fixed

Added this feature. Thanks for the suggestion.

#3

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

#4

Status:fixed» closed (fixed)

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

#5

Version:6.x-1.7» 6.x-1.x-dev
Component:User interface» Code
Category:feature request» bug report
Assigned to:Robbie Sternenberg» Anonymous
Status:closed (fixed)» active

Relevant setting is not working for us. I even stripped the conditionals in author_taxonomy_form_alter() without success. Term textfield never gets the real author name or hardcoded test values when the node is saved.

And yes, we are using Ctools, but node/edit/% overrider is disabled.

Why I suspect Ctools that some other modules like HS also have/had trouble accessing or altering form values with Ctools enabled.

If I am missing something, sorry in advance.

Tx.

D 6.15, Ctools 6.x-1.x-dev (Jan 12), and others attached.

AttachmentSize
mods.txt 5.76 KB

#6

Version:6.x-1.x-dev» 6.x-1.8

Pardon me...

#7

If an 'user name' is associated with an 'author term', then the linked 'author term' should be added to the list, not the 'user name', since they may differ.

Thanks.

#8

For #7, I propose this patch (attached).

AttachmentSize
author_taxonomy_autocomplete.diff 955 bytes

#9

IMO, this feature is incomplete and flaw
- shouldn't the username is appended to existing taxonomy list (author list) instead of overwritten? This help simulates multiple authors or at least that's my interpretation from the description "Automatically add username to author list"
- author term as in #7, example use case is RealName as author term that link to user account
- newly created author term should be automatically linked to the user account by default

Would gladly submit a patch if the above statements are correct.

nobody click here