https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-04-30T09:21:02ZRedmineRedmine - Defect #5406: Watchers selection lost when issue creation failshttps://www.redmine.org/issues/5406?journal_id=162762010-04-30T09:21:02ZFelix Schäfer
<ul></ul><p>I'd say <code>@issue.watched_by?(user)</code> in <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/app/views/issues/_form.rhtml#L36">source:trunk/app/views/issues/_form.rhtml#L36</a> is the culprit as <code>#watched_by?</code> seems to operate only on already created relations.</p> Redmine - Defect #5406: Watchers selection lost when issue creation failshttps://www.redmine.org/issues/5406?journal_id=162782010-04-30T09:31:15ZFelix Schäfer
<ul></ul><p>Ok, the quick and dirty fix would be to replace the aforementioned <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/app/views/issues/_form.rhtml#L36">source:trunk/app/views/issues/_form.rhtml#L36</a> with:</p>
<pre><label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watched_by?(user) || @issue.watcher_user_ids.include?(user.id) %> <%=h user %></label></pre>
<p>That doesn't really solve the underlying problem that <code>#watched_by</code> only works with saved objects and not with those not written to the DB yet though.</p> Redmine - Defect #5406: Watchers selection lost when issue creation failshttps://www.redmine.org/issues/5406?journal_id=162892010-04-30T11:00:17ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Watchers won't survive a new issue error</i> to <i>Watchers selection lost when issue creation fails</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>0.9.4</i></li><li><strong>Affected version (unused)</strong> changed from <i>devel</i> to <i>0.9.3</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li><li><strong>Affected version</strong> set to <i>0.9.3</i></li></ul><p>This is fixed in <a class="changeset" title="Fixed: watchers selection lost when issue creation fails (#5406). #watched_by? was fixed in order..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3705">r3705</a>.</p> Redmine - Defect #5406: Watchers selection lost when issue creation failshttps://www.redmine.org/issues/5406?journal_id=163152010-04-30T17:17:02ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>