snnrk/redmine_mailwrapper — Issue #1: 500 error creating a new recipient
Author: javiruj
Created: 2012-02-23 13:09:58+00:00
State: open

Hi

I've tried to install the plugin following the standard of redmine (rake db:migrate_plugins RAILS_ENV=..., restarting the server...). I've enabled the module for one project and gone to the settings tab.

When I've created a new sender I have no problems but when I've tried to create a new recipient I've obtained a 500 error.
The log:

```Processing MailwrapperRecipientsController#add (for x.x.x.x at 2012-02-23 13:44:54) [GET]
Parameters: {"project_id"=>"sistem-9", "action"=>"add", "controller"=>"mailwrapper_recipients"}
Rendering template within layouts/base
Rendering mailwrapper_recipients/add

ActionView::TemplateError (PGError: ERROR: column "User" does not exist
LINE 1: ...users.type='User' AND users.status=1)) AND (type = "User"))
^
: SELECT "members"."id" AS t0_r0, "members"."user_id" AS t0_r1, "members"."project_id" AS t0_r2, "members"."created_on" AS t0_r3, "members"."mail_notification" AS t0_r4, "users"."id" AS t1_r0, "users"."login" AS t1_r1, "users"."hashed_password" AS t1_r2, "users"."firstname" AS t1_r3, "users"."lastname" AS t1_r4, "users"."mail" AS t1_r5, "users"."admin" AS t1_r6, "users"."status" AS t1_r7, "users"."last_login_on" AS t1_r8, "users"."language" AS t1_r9, "users"."auth_source_id" AS t1_r10, "users"."created_on" AS t1_r11, "users"."updated_on" AS t1_r12, "users"."type" AS t1_r13, "users"."identity_url" AS t1_r14, "users"."mail_notification" AS t1_r15, "users"."salt" AS t1_r16 FROM "members" LEFT OUTER JOIN "users" ON "users".id = "members".user_id WHERE ("members".project_id = 5 AND (users.type='Group' OR (users.type='User' AND users.status=1)) AND (type = "User")) ) on line #2 of vendor/plugins/redmine_mailwrapper/app/views/mailwrapper_recipients/_form.html.erb:
1: <%= error_messages_for 'mailwrapper_recipient' %>
2: <% members = @project.member_principals.find(:all, :conditions => ['type = "User"']).sort %>
3:

<%= f.text_field :name %>

4:

5: <%= f.label :user_ids %>

vendor/plugins/redmine_mailwrapper/app/views/mailwrapper_recipients/_form.html.erb:2
vendor/plugins/redmine_mailwrapper/app/views/mailwrapper_recipients/add.html.erb:4
app/helpers/application_helper.rb:871:in `labelled_tabular_form_for'
vendor/plugins/redmine_mailwrapper/app/views/mailwrapper_recipients/add.html.erb:3
config/initializers/mongrel.rb:62:in `dispatch_cgi'

Rendering .../public/500.html (500 Internal Server Error)

Processing MailwrapperSendersController#mod (for x.x.x.x at 2012-02-23 13:45:03) [GET]
Parameters: {"project_id"=>"sistem-9", "action"=>"mod", "sender_id"=>"1", "controller"=>"mailwrapper_senders"}
Rendering template within layouts/base
Rendering mailwrapper_senders/mod
Completed in 62ms (View: 47, DB: 0) | 200 OK [http://redmine.company.com/mailwrapper_senders/mod?project_id=sistem-9&sender_id=1]
```

Redmine Version: 1.3.0
Database: Postgresql 8.3

Thanks for the plugin.