Project

General

Profile

Redmine 2.1.0 : Authentication Mode Internal 500 Error

Added by Vu Ha Nguyen over 11 years ago

I'm using Redmine 2.1.0 with default and 1 LDAP source authentication mode. My LDAP source authentication mode works perfectly until i have to create an user with Internal (default) mode, and got 500 Error:


ActiveRecord::StatementInvalid (Mysql::Error: Column 'auth_source_id' cannot be null: INSERT INTO `users` (`admin`, `auth_source_id`, `created_on`, `firstnam
e`, `hashed_password`, `identity_url`, `language`, `last_login_on`, `lastname`, `login`, `mail`, `mail_notification`, `salt`, `status`, `type`, `updated_on`)
 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)):
  app/controllers/users_controller.rb:96:in `create'

I think there is a problem in line 28 of ../redmine/app/view/users/_form.html.erb

<p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {$('#password_fields').show();} else {$('#password_fields').hide();}" %></p>

Am I wrong to edit it to:

<p><%= f.select :auth_source_id, ([[l(:label_internal), "0"]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='0') {$('#password_fields').show();} else {$('#password_fields').hide();}" %></p>

(change value of auth_source_id in select authentication mode tag from "Null" to "0" ??!!)

Replies (2)

RE: Redmine 2.1.0 : Authentication Mode Internal 500 Error - Added by Jean-Philippe Lang over 11 years ago

No, there's a problem with your database definition. NULL values are allowed for the auth_source_id column in a proper Redmine database.

RE: Redmine 2.1.0 : Authentication Mode Internal 500 Error - Added by Vu Ha Nguyen over 11 years ago

Jean-Philippe Lang wrote:

No, there's a problem with your database definition. NULL values are allowed for the auth_source_id column in a proper Redmine database.

Thanks Jean-Philippe Lang! I set OFF "Not Null" at the auth_source_id column and everything's ok :)

    (1-2/2)