While reviewing the implementation for issue #4416 I noticed that the links to wikipages bound to versions do not respect version-sharing (introduced in r3123 for issue #465 and enhanced with r3133 for issue #4357) in Settings -> Versions.
This leads to incorrect links when the version does not belong to the current project. More specifically, the links always point to the current project wiki instead of the wiki of the actual versions project.
Another side-effect is that in the unless-statement again only the current project wiki is checked for existence instead of the actual versions project wiki.
I've fixed this by wrapping source:/trunk/app/views/projects/settings/_versions.rhtml#L20 into a basic if-else structure (checking for version.project == @project) and adding a modified else-case statement (added :id-param containing version.project-value and changed unless statement to check version.project.wiki.nil? instead of @project.wiki.nil?).
Here follows my patch (which also "fixes" two coding-standard inconsistencies (my third and fourth change)) which I'll attach seperately also:
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.