Skip to content

Manually creating new category breaks timebank admin #829

@decentral1se

Description

@decentral1se
  • I set locale=NL
  • I create a new category on /admin/categories/new
  • I reload /offers and see a server error message
  • I see the error below in the logs
  • I set locale=EN and return /admin/categories/new to see the category name is empty. I fill it in.
  • The error goes away
ActionView::Template::Error (undefined method `downcase' for nil:NilClass):
Causes:
NoMethodError (undefined method `downcase' for nil:NilClass)
25:           <li>
26:             <%= link_to "× #{t('global.all')}", base_path, class: "dropdown-item" %>
27:           </li>
28:           <% all_categories.each do |c| %>
29:             <% next if c == @category %>
30:             <li>
31:               <%= link_to "#{base_path}?cat=#{c.id}", class: "dropdown-item" do %>

app/helpers/categories_helper.rb:3:in `block in all_categories'
app/helpers/categories_helper.rb:3:in `sort_by'
app/helpers/categories_helper.rb:3:in `all_categories'
app/views/shared/_post_filters.html.erb:28
app/views/offers/index.html.erb:11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions