<div dir="ltr">Ah, right! Thanks. So for the buttons, I really wanted to do:<div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px"> $form['actions']['submit'] = t('Post comment');</div>
<div style="font-family:arial,sans-serif;font-size:13px"> unset($form['actions']['preview']);</div><div style="font-family:arial,sans-serif;font-size:13px"> </div></div><div style="font-family:arial,sans-serif;font-size:13px">
But what also is revealed is that the title <b>Add new comment</b> is not part of the form. I'd appreciate any idea regarding overriding its value. I tried using content: xxx in css, but while I can get the new value to appear doing that, I can't seem to hide the original one without hiding both.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 1, 2013 at 3:30 PM, berliner <span dir="ltr"><<a href="mailto:myberliner@gmail.com" target="_blank">myberliner@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What you did was to alter the node object that was passed into the form builder as an argument.<br>
Instead var_dump the entire $form array and look for keys that do not start with a dash. Those are the ones that will finally be rendered. Keys starting with a dash control how they are rendered.<br>
Take a look at the examples in the docs: <a href="https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7" target="_blank">https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7</a><br>
<br>
best regards,<br>
berliner<br>
<br>
Am 01.11.2013 um 19:34 schrieb Jeff Greenberg <<a href="mailto:listmail.ayendesigns@gmail.com">listmail.ayendesigns@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5"><br>
> I have the following code in my module:<br>
><br>
> function mymodule_form_alter(&$form, &$form_state, $form_id) {<br>
> if ($form_id == 'comment_node_blog_form') {<br>
> $form['#node']->content['links']['comment']['#links']['comment-add']['title'] = t('Post a comment');<br>
> $form['#node']->actions['submit'] = t('Post comment');<br>
> unset($form['#node']->actions['preview']);<br>
> var_dump($form);<br>
> }<br>
><br>
> When I look at the var_dump, the form fields are set as intended. However, in looking at the form, the title still has "Add new comment", the submit button is unchanged, and the preview button is still present.<br>
><br>
> In searching the page content (including the var_dump output) the ONLY place 'Add' exists is in the text of the form ... NOT in the content of the var_dump. The only way I can see that happening is if the form array is being changed back after my hook, so I tried changing the module weight to 99 (via mysql) and clearing cache. No difference.<br>
><br>
><br>
> --<br>
> ---<br>
> <a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a><br>
> <a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a><br>
> <a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a><br>
> @accidentalcoder<br>
</div></div><span class="HOEnZb"><font color="#888888">> --<br>
> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div>
<div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div>
</div>