I installed flashcard on my drupal 7.8 site, and got this error when I enabled it:

FieldException: Attempt to create a field of unknown type flashcard. in field_create_field() (line 106 of /xxx/xxx/public_html/xxx.com/drupal7/modules/field/field.crud.inc).

Comments

tim.plunkett’s picture

I can look into this, but when writing that code it turns out that the creation of fields upon install can be pretty buggy. Hence the new Field API Helper module: http://drupal.org/project/field_helper
I might have to rewrite this to depend on that.

drupalshrek’s picture

Just installed your flashcard module to take a look, but indeed it still gives the following error:

FieldException: Attempt to create a field of unknown type flashcard. in field_create_field() (line 110 of C:\ProgramData\Apache Group\www\my_test_site\modules\field\field.crud.inc).

neeravbm’s picture

Here is a temporary fix when you want to install the Flashcard module. Disable and uninstall the flashcard module if you had enabled it previously. Go to line 474 of modules/field/field.info.inc file. The code looks something like this:

/**
 * Returns information about field types from hook_field_info().
 *
 * @param $field_type
 *   (optional) A field type name. If omitted, all field types will be
 *   returned.
 *
 * @return
 *   Either a field type description, as provided by hook_field_info(), or an
 *   array of all existing field types, keyed by field type name.
 */
function field_info_field_types($field_type = NULL) {
  _field_info_collate_types(TRUE);
  $info = _field_info_collate_types();
  $field_types = $info['field types'];

Just when the function starts, insert the following line:
_field_info_collate_types(TRUE);

The eventual code looks like this:

/**
 * Returns information about field types from hook_field_info().
 *
 * @param $field_type
 *   (optional) A field type name. If omitted, all field types will be
 *   returned.
 *
 * @return
 *   Either a field type description, as provided by hook_field_info(), or an
 *   array of all existing field types, keyed by field type name.
 */
function field_info_field_types($field_type = NULL) {
  _field_info_collate_types(TRUE);
  $info = _field_info_collate_types();
  $field_types = $info['field types'];

Now enable the module. It will take a while but the flashcard module should have been installed. Now delete the line _field_info_collate_types(TRUE) from the code above.

Neerav.
http://redcrackle.com