Defect #18060

Selected projects in email notifications on "my account" are lost when the page is redisplayed after a validation error.

Added by Felix Schäfer almost 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Email notifications
Target version:2.6.1
Resolution:Fixed Affected version:2.5.2

Description

On "my account" with "for any event on the selected projects only" selected in the email notifications area and some projects selected for that, the selected projects (newly selected and already saved) are lost if the page gets redisplayed after for example a validation error (no first name for example).

18060-coerce_ids_to_integers (1.09 KB) Felix Schäfer, 2014-10-10 15:59

Associated revisions

Revision 13638
Added by Jean-Philippe Lang almost 4 years ago

Selected projects in email notifications on "my account" are lost when the page is redisplayed after a validation error (#18060).

Patch by Felix Schäfer.

History

#1 Updated by Felix Schäfer almost 4 years ago

The problem is that User#notified_projects_ids= source:/trunk/app/models/user.rb@13435#L355 may receive an array of strings, for example from an update through a web form, which is stored as is. source:/trunk/app/views/users/_mail_notifications.html.erb@13435#L16 on the other hand expects an array of integers to populate the form.

The attached patch makes sure anything passed to User#notified_projects_ids= is stored as an array of integers in the instance variable.

#2 Updated by Toshi MARUYAMA almost 4 years ago

  • Target version set to 2.6.1

#3 Updated by Jean-Philippe Lang almost 4 years ago

Patch committed in r13638.

#4 Updated by Jean-Philippe Lang almost 4 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Also available in: Atom PDF