How do I remove default comment validation in drupal 7? Drupal is showing error message for empty comments by default. how can i remove that error message.
Note:- (I have not written any custom validation. It's the default validation provided by drupal module.) My changes in comment.module

if (empty($comment-&gt;cid) &amp;&amp; empty($comment-&gt;pid)) { 
if(($form['#node']-&gt;type=='iks_videos_youtube_video') || ($form['#node']-               &gt;type=='iks_videos_vimeo_video' || $form['#node']-&gt;type=='iks_videos_video')){
if(isset($form['#node']-&gt;type) &amp;&amp; $form['#node']-&gt;type=='iks_videos_youtube_video')
{   $vtype='yt';}
else
{   $vtype='v'; }
$form['#action'] = url('video/' . $form['#node']-&gt;video_id[LANGUAGE_NONE][0]['value'] . '/'.$vtype.'/' . strtolower(str_replace(' ', '_', $form['#node']-&gt;title)));
  }else{
$form['#action'] = url('comment/reply/' . $comment-&gt;nid);}


}

my custom module code

function  iks_videos_form_comment_node_iks_videos_youtube_video_form_alter(&amp;$form, $form_estate) {
if (isset($form['actions']['preview']))
unset($form['actions']['preview']);
$form['subject']['#access'] = FALSE;
unset($form['author']['mail']['#description']);
$form['#submit'][] = '_iks_videos_comment_form_submit';
    }


alter form

function _iks_videos_comment_form_submit($form, &amp;$form_estate) {

if(($form['#node']-&gt;type) &amp;&amp; $form['#node']-&gt;type=='iks_videos_youtube_video')
    $vtype='yt';
else 
    $vtype='v';
$form_estate['redirect'][0] = 'video/' . $form['#node']-&gt;video_id[LANGUAGE_NONE][0]['value'] . '/'.$vtype.'/' . strtolower(str_replace(' ', '_', $form['#node']-&gt;title));


}
You can see error message because comment_body is required for comment entity.
You can delete #required parameter for comment_body:

function my_module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if(strpos($form_id, 'comment_node_erpal_task_form') !== FALSE) {
    $form['comment_body'][LANGUAGE_NONE][0]['#required'] = FALSE;
  }
}


But just know that you'll have php notice then. Because posting comment without the body is not right:


  Notice: Undefined offset: 0 in comment_submit() (line 2197 of
  W:\home\erpal.local\www\modules\comment\comment.module).


Make sure yhat you added custom validation for body field.

You you can handle validation callbacks for the whole form in $form['#validate'] array. Also you can handle validation callbacks for each form element in #element_validate array. E.g. for comment_body:

$form['comment_body'][LANGUAGE_NONE]['#element_validate'][] = '_my_module_comment_body_validate';


Update

You musn't change any code in Drupal core modules, it's very bad hardcode. You can do all your logic that you added to comment.module in hook_form_alter.

function my_module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if(strpos($form_id, 'comment_node_erpal_task_form') !== FALSE) {
    $form['comment_body'][LANGUAGE_NONE][0]['#required'] = FALSE;

    if(isset($form['#node']-&gt;type) &amp;&amp; $form['#node']-&gt;type=='iks_videos_youtube_video') {
      $vtype='yt';
    }
    else {
      $vtype='v'; 
    }

    $url = url('video/' . $form['#node']-&gt;video_id[LANGUAGE_NONE][0]['value'] . '/'.$vtype.'/' . strtolower(str_replace(' ', '_', $form['#node']-&gt;title))); 
    $form['#action'] =  $url;  
  }
}