Commit 1e0c8ccd4887c17f1ef5fa4cc2613e055686319a

Authored by Larissa Reis
1 parent 60b69b3c

Fixes crash in manage friends page when friend has own domain

  When a profile has its own domain, Profile#url[:profile] is nil, which
  cause the links routed using Profile#url to break since they expected
  an profile value.

  I could find this problem in two places where it was assumed that the
  Profile#url hash has the profile value not nil. This patch adds
  profile in the url so the route matches.

(ActionItem2385)
app/views/friends/index.rhtml
... ... @@ -31,7 +31,7 @@
31 31 :class => 'button icon-remove',
32 32 :title => _('remove') %>
33 33 <%= link_to content_tag('span',_('contact')),
34   - friend.url.merge(:controller => 'contact', :action => 'new'),
  34 + friend.url.merge(:controller => 'contact', :action => 'new', :profile => friend.identifier),
35 35 :class => 'button icon-menu-mail',
36 36 :title => _('contact') %>
37 37 </div><!-- end class="controll" -->
... ...
app/views/search/communities.rhtml
... ... @@ -4,7 +4,7 @@
4 4 <% if logged_in? %>
5 5 <% button_bar do %>
6 6 <%# FIXME shouldn't the user create the community in the current environment instead of going to its home environment? %>
7   - <%= button(:add, __('New community'), user.url.merge(:controller => 'memberships', :action => 'new_community')) %>
  7 + <%= button(:add, __('New community'), user.url.merge(:controller => 'memberships', :action => 'new_community', :profile => user.identifier)) %>
8 8 <% end %>
9 9 <% end %>
10 10  
... ...