[support] D7 Trouble altering comment form

Jeff Greenberg listmail.ayendesigns at gmail.com
Fri Nov 1 18:34:46 UTC 2013


I have the following code in my module:

    function mymodule_form_alter(&$form, &$form_state, $form_id) {
      if ($form_id == 'comment_node_blog_form') {

$form['#node']->content['links']['comment']['#links']['comment-add']['title']
= t('Post a comment');
        $form['#node']->actions['submit'] = t('Post comment');
        unset($form['#node']->actions['preview']);
    var_dump($form);
  }

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.

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.


-- 
---
drupal.org/user/367108
linkedin.com/in/jeffrgreenberg
accidentalcoder.com / ayendesigns.com
@accidentalcoder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20131101/2800d732/attachment.html 


More information about the support mailing list