Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291280

Extra field on comment

$
0
0

The problem is that if you make a custom module with too light weight, comment.module erase all extra_field.
line 170

<?php
 
foreach (node_type_get_types() as $type) {
    if (
variable_get('comment_subject_field_'. $type->type, 1) == 1) {
     
$return['comment']['comment_node_'. $type->type] = array(
       
'form'=> array(
         
'author'=> array(
           
'label'=> t('Author'),
           
'description'=> t('Author textfield'),
           
'weight'=> -2,
          ),
         
'subject'=> array(
           
'label'=> t('Subject'),
           
'description'=> t('Subject textfield'),
           
'weight'=> -1,
          ),
        ),
      );
    }
  }
?>

should by
<?php
 
foreach (node_type_get_types() as $type) {
    if (
variable_get('comment_subject_field_'. $type->type, 1) == 1) {
     
$return['comment']['comment_node_'. $type->type]['form'] ['author']= array(
           
'label'=> t('Author'),
           
'description'=> t('Author textfield'),
           
'weight'=> -2,
          );
     
$return['comment']['comment_node_'. $type->type]['form'] ['subject']= array(

           
'label'=> t('Subject'),
           
'description'=> t('Subject textfield'),
           
'weight'=> -1,
          );
 
    }
?>

Viewing all articles
Browse latest Browse all 291280

Trending Articles