sorry to post this here, but i didnt thought any other place would be as relevant as this

I have installed usernode guestbook and nothing went wrong (no script errors) but when i check the user node or user profile i see fields to input the comments for user but i dont see a link for submit. I mean the submit text doesnt have the hyperlink its just the text. I do know what to do so am here submitting for your help.

thanks

Comments

chiefguest’s picture

chiefguest’s picture

marcor’s picture

Title: no hyperlink on submit text » no preview button (how to enable the submit button instead)
Assigned: Unassigned » marcor
Category: bug » support

Usernode guestbook uses the original comment buttons to post a guestbook entry like a comment. Due to some ugly nesting in preview mode (the preview is rendered like a comment and the comment itself is rendered inside of this again) I disabled the preview mode, because I currently see no well designed solution for this. Our Drupal gurus may know what to do here and I will change this as soon as I know.

Until then it is advised to let users submit comments without previewing. I suppose the problem is that you have set comment previewing to required. So here's my advice:

Recommended configuration

  1. Go to admin/content/comment/settings
  2. Set "Preview comment" to "Optional"

Please post if it helped you.

marcor’s picture

Status: Active » Reviewed & tested by the community

Will be fixed in next dev version. Even if preview is required for comments usernode guestbook entries will have a submit button.
Preview is not possible yet due to a rendering problem. We need a more elegant solution for this instead of complete rewrite of the form.

Old or potentially new code is commented out.

/**
 * Implementation of hook_form_alter to change appearence of comment_form
 * especially for usernodes.
 *
 * @param string $form_id
 *   name of the form
 * @param array $form
 *   editable form array by reference
 */
function usernode_guestbook_form_alter($form_id, &$form) {
  if ($form_id == 'comment_form') {
    $node = node_load(array('nid' => $form['nid']['#value']));
    if ($node->type == 'usernode') {
      unset($form['subject']);
      $form['comment_filter']['comment']['#rows'] = 3;
      $form['comment_filter']['comment']['#title'] = t('Leave a message');
      /*
      if (variable_get('comment_preview', COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) {
        unset($form['preview']);
      }
      else {
        $op = isset($_POST['op']) ? $_POST['op'] : '';
        $form['preview']['#value'] = t('Preview');
        if ($op == t('Preview')) {
          $form['#after_build'] = array('comment_form_add_preview');
          $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 20);
        }
      }
      */
      // Previewing is ugly because the form is rendered as a comment
      // and preview is rendered inside of this again. Always show submit button.
      unset($form['preview']);
      $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 20);
      $form['#redirect'] = _usernode_guestbook_redirect($node->uid, 'comments');
    }
  }
}
marcor’s picture

Status: Reviewed & tested by the community » Fixed

committed into latest dev version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.