Hi,

This module is a really great idea ! But... ;-)

After having installed it, on an existing quiz, when I click on "Draw from results", I have the following messages :

user warning: Unknown column 'field_quiz_raffle_results_uid' in 'field list' query: INSERT INTO content_field_quiz_raffle_results (vid, nid, delta, field_quiz_raffle_results_uid) VALUES (84, 77, 1, 3) in /var/www/test/sites/all/modules/cck/content.module on line 1213.

Looking at my database, it appears than the field_quiz_raffle_results_uid column does not exist... :

mysql> DESCRIBE content_field_quiz_raffle_results;
+-------+------------------+------+-----+---------+-------+
| Field | Type             | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| vid   | int(10) unsigned | NO   | PRI | 0       |       | 
| nid   | int(10) unsigned | NO   | MUL | 0       |       | 
| delta | int(10) unsigned | NO   | PRI | 0       |       | 
+-------+------------------+------+-----+---------+-------+

I have no idea why...

Best regards,

Comments

meba’s picture

Do you have CCK installed?

simon georges’s picture

Yes (it is a prerequisite of the module installation), and there was no error message during install, that's why I didn't understand why it wasn't working.
On my content type "Quiz", a User Reference field has been added.

If it helps, here is the CCK export of my content type :

$content['type']  = array (
  'name' => 'Quiz',
  'type' => 'quiz',
  'description' => 'Create interactive quizzes for site visitors',
  'title_label' => 'Title',
  'body_label' => 'Body',
  'min_word_count' => 0,
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => true,
    'sticky' => false,
    'revision' => false,
  ),
  'old_type' => 'quiz',
  'orig_type' => 'quiz',
  'module' => 'quiz',
  'custom' => false,
  'modified' => false,
  'locked' => true,
  'reset' => 'Reset to defaults',
);
$content['fields']  = array (
  0 => 
  array (
    'label' => 'Quiz raffle',
    'field_name' => 'field_quiz_raffle_results',
    'type' => 'userreference',
    'widget_type' => 'userreference_autocomplete',
    'change' => 'Change basic information',
    'weight' => '31',
    'autocomplete_match' => 'contains',
    'size' => '30',
    'reverse_link' => 0,
    'description' => '',
    'default_value' => 
    array (
      0 => 
      array (
        'uid' => NULL,
        '_error_element' => 'default_value_widget][field_quiz_raffle_results][0][uid][uid',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => NULL,
    'required' => 0,
    'multiple' => '1',
    'referenceable_roles' => 
    array (
      2 => false,
    ),
    'referenceable_status' => '',
    'op' => 'Save field settings',
    'module' => 'userreference',
    'widget_module' => 'userreference',
    'columns' => 
    array (
      'uid' => 
      array (
        'type' => 'int',
        'unsigned' => true,
        'not null' => false,
        'index' => true,
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);

I hope you'll find the problem, because for the moment, I'm lost...

Best regards,

simon georges’s picture

Status: Active » Closed (fixed)

Hi.

I tried to uninstall the module, install it again, everything is fine now... I tried the installation using drush and directly with the drupal administration, both worked perfectly, I absolutely don't know what was the problem the first time I tried...

Sorry for the false alarm.

Great module indeed ;) !

Regards,

simon georges’s picture

Status: Closed (fixed) » Active

Hi,

As a colleague of mine ran into the same problem, I did a little digging.

The problem appears on a fresh installation when userreference is not installed. When you try to install Quiz_Raffle (either with Drush or using the interface), UserReference is installed as well, but I ran into the same problem each time, with the same error message than my first post...

I hope it will help you to reproduce and fix it.

Regards,

meba’s picture

Yes, it seems that dependency on userreference is not enough in order to ensure User Reference module exists when Quiz Raffle is installed :-) I will dig into this later on.

For others who stumble on this bug: Just uninstall the module (disable & then uninstall) and then install it again.