Posted by nicholas.alipaz on February 25, 2009 at 5:56am
| 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:
<?phpfunction 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
Added this feature. Thanks for the suggestion.
#3
thanks for the addition. I will grab the new version soon!
#4
Automatically closed -- issue fixed for 2 weeks with no activity.
#5
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.
#6
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).
#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.