No Authoring information passed

surge_martin - July 19, 2007 - 17:22
Project:Addnode
Version:5.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I just installed and used Addnode for the first time, and it worked, but the child node was put through with an Anonymous author, not the user I was logged in with. It probably should pass through the info from the main form.

#1

o2se3tak - July 22, 2007 - 05:59

Can anyone suggest how this can be rectified?

Thanks!

#2

surge_martin - August 3, 2007 - 11:38

I think I managed to solve this one myself, by adding the following line to addnode_fix_subform:

$form_element['#form']['author']['name']['#value'] = $user->name;

The only thing is, I'd actually like to hide the publishing and options fieldsets altogether. I was able to accomplish that by changing the lines that remove the submit and preview buttons to be:

  foreach (array('preview', 'submit', 'delete', 'author','options') as $name) {
    $form_element['#form'][$name]['#access'] = FALSE;
  }

Unfortunately, doing this breaks the name field fix. Anyone know how I might be able to accomplish this?

#3

surge_martin - August 3, 2007 - 11:50

I almost forgot, you also need to add $user to the list of globals for addnode_fix_subform.

#4

daxton - August 9, 2007 - 03:11

Thanks for the tip on auto-filling the authoring info.

You should be able to hide the Authoring and Options fieldsets with some CSS:

span.addnode_form div.admin {
display: none;
}

#5

DynV - March 10, 2008 - 11:14

I'm also having this issue. Being 30 weeks old, is there any plan to include it in a 5.x version ?

surge_martinI almost forgot, you also need to add $user to the list of globals for addnode_fix_subform.

I wonder where to find addnode_fix_subform, the function containing the samples as well as the global list. It would be nice if there was a patch available for those fixes.

 
 

Drupal is a registered trademark of Dries Buytaert.