Thank you.<br><br><div><span class="gmail_quote">On 5/20/06, <b class="gmail_sendername">Dave Cohen</b> <<a href="mailto:drupal@dave-cohen.com">drupal@dave-cohen.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sent this from the wrong address originally...<br><br>---------- Forwarded Message ----------<br><br>Subject: Re: [development] #just_before_validation ?<br>Date: Saturday 20 May 2006 14:30<br>To: <a href="mailto:development@drupal.org">
development@drupal.org</a><br><br>If you are defining the node type:<br><br>in hook_form(), no need to set $form['title'].<br><br>In yournodetype_node_form_submit($form_id, $form_values), do something like:<br><br>$form_values['title'] = 'whatever you want';
<br>return node_form_submit($form_id, $form_values);<br><br><br>If you're not defining the node type, you can probably remove the title in<br>hook_form_alter, and do the same thing in the _submit().<br><br>-Dave<br><br>On Saturday 20 May 2006 01:16, Bčr Kessels wrote:
<br>> Hi,<br>><br>> I am looking for the following: I want to generate the title of a node from<br>> content in that node.<br>><br>> Hence I need to hook into the node submission on several places.<br>>
<br>> First: hook_form_alter, to make the title field hidden<br>> Then just *before* validation to capture the node content and fill a title.<br>> So that all possible validation hooks can still run, but that the title has
<br>> a value.<br>><br>> Any idea what kind of hook, or #callback I should be looking at?<br>><br>> #validate is not a good option, since I think it is important to run all<br>> the normal validations on that title field. But maybe the trick is to set
<br>> that #validate, and inside that callback function fill the title value and<br>> then call all the validation hooks from there? I am personally not a fan of<br>> using validation to cahnge values. Validation is for.... validation.
<br>><br>> Also important is, that this needs a POST, because I have to grab info from<br>> that POSTed node.<br>><br>> Bčr<br><br>-------------------------------------------------------<br></blockquote></div>
<br>