Skip to main content
added 146 characters in body
Source Link
Shyghar
  • 1.1k
  • 16
  • 30

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) { 

   watchdog('start field_instagram_field_schema()', 'We are in!');

   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

ThisUPDATED
When i install the module and create a field of this new type this function is my codenot runned. There is somthing wrong?.

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) {
   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

This is my code. There is somthing wrong?

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) { 

   watchdog('start field_instagram_field_schema()', 'We are in!');

   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

UPDATED
When i install the module and create a field of this new type this function is not runned..

deleted 10 characters in body
Source Link
Shyghar
  • 1.1k
  • 16
  • 30

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) {
   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'instagram_input_tag''input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

This is my code. There is somthing wrong?

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) {
   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'instagram_input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

This is my code. There is somthing wrong?

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) {
   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

This is my code. There is somthing wrong?

Source Link
Shyghar
  • 1.1k
  • 16
  • 30

hook_field_schema() does not work

I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.

 function field_instagram_field_schema($field) {
   switch ($field['type']) {
    case 'instagram_gallery':
      $columns = array(
        'stream_type' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'instagram_input_tag' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
         'thumb_dimetion' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        ),
        'thumb_number' => array(
          'type' => 'varchar',
          'length' => '25',
          'not null' => FALSE
        )
      );
      break;
  }

  return array('columns' => $columns);
}

This is my code. There is somthing wrong?