The form_alter hook checks whether $form['#id'] is set to "comment-form", but when you have multiple comment forms on a page (don't ask -- they're being dynamically shown/hidden) the value of $form['#id'] can be "comment-form-1", "comment-form-2", etc., so the correct format is never applied.

The value of $form_id which is passed into the form_alter hook is always equal to "comment_form" though. Any idea why this is not used instead (as it is further down in the function)?

Comments

dragonwize’s picture

Status: Active » Postponed (maintainer needs more info)

$form_id changes in certain circumstances. I am curious what is creating the differing comment form ids on your end. I will have to do testing to ensure that $form_id is staying consistent on that form before I am comfortable making that change. Knowing exactly how you are building the forms and seeing differences will help. Especially what node types they are attached to, as this would only work on node related comments anyway.

dragonwize’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)