On the "My Account" > "Edit" page, users always have the "Signature" text box, even if "Signature supprt" is selected as "disabled" on admin/user/settings .

Comments

OneTwoTait’s picture

how did I post that under Node Comments... I don't know. :P

wrb123’s picture

I am having the same problem: at /admin/user/settings, under Signatures I have "Signature support: Disabled", and yet users still think they can use signatures because the option appears on their profile/edit page. I think this is indeed a nodecomment bug, that may have to do with disabling the original Comment module (the option for Signature shows up under "Comment Settings." I would like to disable nodecomment, enable comment, enable signatures, disable signatures, disable comment, and enable nodecomment, however I'm afraid that will cause some damage to my site (database maybe). I'm afraid that even if it temporarily works when Comment is enabled, when I then re-enable NodeComment it will be broken again.

wrb123’s picture

okay, so...

i switched:

function nodecomment_user($type, $edit, &$user, $category = NULL) {
  if ($type == 'form' && $category == 'account') {
    // when user tries to edit his own data
    $form['nodecomment_settings'] = array(
      '#type' => 'fieldset',
      '#title' => t('Comment settings'),
      '#collapsible' => TRUE,
      '#weight' => 4);
    $form['nodecomment_settings']['signature'] = array(
      '#type' => 'textarea',
      '#title' => t('Signature'),
      '#default_value' => $edit['signature'],
      '#description' => t('Your signature will be publicly displayed at the end of your comments.'));

    return $form;
  }
}

to:

function nodecomment_user($type, $edit, &$user, $category = NULL) {
  if ($type == 'form' && $category == 'account') {
    // when user tries to edit his own data
    $form['nodecomment_settings'] = array(
      '#type' => 'fieldset',
      '#title' => t('Comment settings'),
      '#collapsible' => TRUE,
      '#weight' => 4);
    $form['nodecomment_settings']['signature'] = array(
      '#type' => 'textarea',
      '#title' => t('Signature'),
      '#default_value' => $edit['signature'],
      '#description' => t('Your signature will be publicly displayed at the end of your comments.'));

    /* return $form; */
  }
}

in nodecomment.module (just commented out the line "return $form;" and now the signature field totally disappears in user profile -> edit! :)
that function is just hooking or intercepting the user form for their account so it can add its own field (signature option), and im letting it intercept it, yet preventing it from actually adding the form to the page. i hope this doesnt cause any unforseen problems, but i think it's pretty harmless.

maybe the maintainer or someone with more knowledge of modules than me could figure out how to patch this... im thinking it might be something like changing:

  if ($type == 'form' && $category == 'account') 

to

if ($type == 'form' && $category == 'account' && variable_get('user_signatures',1))

or maybe

return $form;

to

if (variable_get('user_signatures',1))
{ return $form; }

although i definitely havent tested that and i dont know if the code is valid, so for now i would recommend the hack of commenting out the return of the form rather than modifying all the other code, although i would love to see this implemented as a patch by someone more knowledable than me!

-bill

robbiethegeek’s picture

StatusFileSize
new8.24 KB

Here is a patch that makes the node comment module recognize and abide by the choosing of whether there are signatures on the site.

Please review

wrb123’s picture

thank you robbiethegeek! i will review this in the next few days. i appreciate it.

zroger’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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