cthit / chalmersit-rails

Chalmers.it built with Rails
MIT License
4 stars 6 forks source link

Removal of "Legacy" group breaks old posts #291

Closed lindskogen closed 7 years ago

lindskogen commented 7 years ago

See for example posts made by Horv: https://chalmers.it/posts?user=johandf

F, [2017-08-08T20:37:41.443207 #15647] FATAL -- :
ActionView::Template::Error (undefined method `name' for nil:NilClass):
    11:         <%= link_to post.comments.size, post_path(post, anchor: 'comments'), title: "#{post.comments.size} #{Comment.model_name.human(count:post.comments.size).downcase}", class: 'comments-bubble smooth', data: { tooltip: '' } %>
    12:         <span class="sep">|</span> <time data-tooltip title="<%= t 'published' %> <%= post.created_at.to_s(:iso_date_time) %>" datetime="<%= post.created_at.to_s(:rfc822) %>" pubdate itemprop="datePublished"><%= post.created_at.to_s(:day_month) %></time>
    13:         <span class="sep">|</span> <%= link_to t('permalink'), post %>
    14:         <span class="sep">|</span>  <%= t '.posted_for' %> <%= link_to_committee post %> <%= t '.by' %> <%= link_to post.user.display_name, posts_path(user: post.user), title: "#{t '.posts_by'} #{post.user.display_name}", rel: 'author' %>
    15:         <% if policy(post).update? %>
    16:           <span class="sep">|</span> <%= link_to t('helpers.submit.update', model: Post.model_name.human.downcase), edit_post_path(post) %>
    17:         <% end %>
  app/helpers/posts_helper.rb:29:in `link_to_committee'
  app/views/posts/_post.html.erb:14:in `_app_views_posts__post_html_erb___1868493670942335549_47075385907180'
  app/views/posts/index.html.erb:3:in `_app_views_posts_index_html_erb___2110157584837852064_47075382429800'

This is because the group with id=legacy does not exist

williamleven commented 7 years ago

The group with id=legacy has been been created again and the error does no longer appear. Do however keep this issue open as the legacy should be removed in some manner.

malmers commented 7 years ago

Opened #309 as the legacy committee has been reintroduced