Tested twice on clean install. Used cck, view, and autoload. Attempted to make changes in the quiz form configuration and sql error was displayed.

user warning: Field 'aid' doesn't have a default value query: INSERT INTO quiz_user_settings (uid, nid, vid, pass_rate, summary_pass, summary_default, randomization, backwards_navigation, keep_results, repeat_until_correct, feedback_time, display_feedback, takes, show_attempt_stats, time_limit, quiz_always, has_userpoints, allow_skipping, allow_resume, allow_jumping) VALUES (3, 0, 0, 75, '', '', 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0) in....

Did not find this error in search so I assume it could just be me.

Comments

Jim Kirkpatrick’s picture

Version: 6.x-4.2 » 6.x-4.3

We get this too: 'aid' field doesn't have default value. It prevents me saving admin/quiz/settings/quiz_form.

Related to:

Jim Kirkpatrick’s picture

Title: SQL error » SQL error on /admin/quiz/settings/quiz_form: 'aid' field doesn't have default value

Probably a dupe of of #922316: Error on saving admin/quiz/settings/quiz_form except the 'aid' field is complaining, not the 'nid' field.

We went from 3.x to 4.0 branch, then from 4.0 to 4.3... Did we miss a schema update?

Jim Kirkpatrick’s picture

Further to my last, I believe the call that causes the issue is drupal_write_record('quiz_user_settings', $node, $update); on in quiz.module, line 3950.

I updated the quiz_admin_node_form_submit() preparation function on line 324 of quiz.admin.inc and added a default value with this line of code: $form_state['values']['aid'] = '';

So the function should look like:

function quiz_admin_node_form_submit($form, &$form_state) {
  // We add the uid for the "default user"
  $form_state['values']['save_def_uid'] = variable_get('quiz_def_uid', NULL);
  $form_state['values']['nid'] = 0;
  $form_state['values']['vid'] = 0;
  $form_state['values']['aid'] = '';
  _quiz_save_user_settings($form_state['values']);
}

Works for me, I can now save that form.

Jim Kirkpatrick’s picture

Status: Active » Needs review
falcon’s picture

Status: Needs review » Closed (fixed)

Thanks

  • Commit 094dfcb on 7.x-4.x, 7.x-5.x authored by falcon, committed by paalj:
    Fix #1317244 by Jim Kirkpatrick: Make it possible to save the quiz form...

  • Commit 094dfcb on 7.x-4.x, 7.x-5.x, quiz-pages authored by falcon, committed by paalj:
    Fix #1317244 by Jim Kirkpatrick: Make it possible to save the quiz form...

  • Commit 094dfcb on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 authored by falcon, committed by paalj:
    Fix #1317244 by Jim Kirkpatrick: Make it possible to save the quiz form...

  • Commit 094dfcb on 7.x-4.x, 7.x-5.x, 2269219 authored by falcon, committed by paalj:
    Fix #1317244 by Jim Kirkpatrick: Make it possible to save the quiz form...