https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-09-20T03:44:41ZRedmineRedmine - Defect #6435: Links to wikipages bound to versions do not respect version-sharing in Settings -> Versionshttps://www.redmine.org/issues/6435?journal_id=204872010-09-20T03:44:41ZMischa The Evil
<ul><li><strong>File</strong> <a href="/attachments/4506">6435-fix_links_to_wikipages_with_version-sharing.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4506/6435-fix_links_to_wikipages_with_version-sharing.diff">6435-fix_links_to_wikipages_with_version-sharing.diff</a> added</li></ul><p>I've fixed this by wrapping <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/app/views/projects/settings/_versions.rhtml#L20">source:/trunk/app/views/projects/settings/_versions.rhtml#L20</a> into a basic if-else structure (checking for <code>version.project == @project</code>) and adding a modified else-case statement (added <code>:id</code>-param containing <code>version.project</code>-value and changed <code>unless</code> statement to check <code>version.project.wiki.nil?</code> instead of <code>@project.wiki.nil?</code>).</p>
<p>Here follows my patch (which also "fixes" two coding-standard inconsistencies (my third and fourth change)) which I'll attach seperately also:<br /><pre><code class="diff syntaxhl"><span class="gh">Index: app/views/projects/settings/_versions.rhtml
===================================================================
</span><span class="gd">--- app/views/projects/settings/_versions.rhtml (revision 4101)
</span><span class="gi">+++ app/views/projects/settings/_versions.rhtml (working copy)
</span><span class="p">@@ -6,7 +6,7 @@</span>
<th><%= l(:field_description) %></th>
<th><%= l(:field_status) %></th>
<th><%= l(:field_sharing) %></th>
<span class="gd">- <th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th>
</span><span class="gi">+ <th><%= l(:label_wiki_page) %></th>
</span> <th style="width:15%"></th>
</tr></thead>
<tbody>
<span class="p">@@ -17,13 +17,19 @@</span>
<td class="description"><%=h version.description %></td>
<td class="status"><%= l("version_status_#{version.status}") %></td>
<td class="sharing"><%=h format_version_sharing(version.sharing) %></td>
<span class="gd">- <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td>
</span><span class="gi">+ <td>
+ <% if version.project == @project %>
+ <%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %>
+ <% else %>
+ <%= link_to(h(version.wiki_page_title), :controller => 'wiki', :id => version.project, :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || version.project.wiki.nil? %>
+ <% end %>
+ </td>
</span> <td class="buttons">
<% if version.project == @project %>
<span class="gd">- <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %>
</span><span class="gi">+ <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version}, :class => 'icon icon-edit' %>
</span> <%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %>
<% end %>
<span class="gd">- </td>
</span><span class="gi">+ </td>
</span> </tr>
<% end; reset_cycle %>
</tbody>
</code></pre></p>
<p>As visible from my 1st change it is required in Redmine now to always show the Wikipage heading because of that it is possible that inherited versions contain bound wikipages while the current projects wiki does not exist.</p> Redmine - Defect #6435: Links to wikipages bound to versions do not respect version-sharing in Settings -> Versionshttps://www.redmine.org/issues/6435?journal_id=204882010-09-20T03:48:56ZMischa The Evil
<ul></ul><p>Added relation to issue <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Link from version details page to edit the wiki. (Closed)" href="https://www.redmine.org/issues/4416">#4416</a> cause of its similarity regarding the scoping of links (started by Jean-Baptiste Barth in <a href="http://www.redmine.org/issues/4416#note-6" class="external">note-6</a>).</p> Redmine - Defect #6435: Links to wikipages bound to versions do not respect version-sharing in Settings -> Versionshttps://www.redmine.org/issues/6435?journal_id=209162010-10-01T23:18:38ZEric Davis
<ul><li><strong>Category</strong> changed from <i>Projects</i> to <i>Roadmap</i></li><li><strong>Target version</strong> set to <i>1.0.3</i></li></ul> Redmine - Defect #6435: Links to wikipages bound to versions do not respect version-sharing in Settings -> Versionshttps://www.redmine.org/issues/6435?journal_id=218512010-10-27T18:06:12ZFelix Schäfer
<ul></ul><p>Included in a fix for <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Link from version details page to edit the wiki. (Closed)" href="https://www.redmine.org/issues/4416">#4416</a>, I didn't take the if-block though, as it seems superfluous.</p> Redmine - Defect #6435: Links to wikipages bound to versions do not respect version-sharing in Settings -> Versionshttps://www.redmine.org/issues/6435?journal_id=219522010-10-29T22:35:36ZJean-Baptiste Barth
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Mischa The Evil</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fix applied in <a class="changeset" title="Fix wikilinks in project > settings > versions and version view. #6435 #4416 Contributed by Misc..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4307">r4307</a>, thanks Mischa & Felix.</p> Redmine - Defect #6435: Links to wikipages bound to versions do not respect version-sharing in Settings -> Versionshttps://www.redmine.org/issues/6435?journal_id=220142010-11-01T00:22:51ZEric Davis
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged into 1.0-stable for release in 1.0.3</p>