Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a browser with a locale which has no translated content in the corresponding locale breaks the admin view ⁠⁠⁠⁠/admin/categories #395

Open
rschaerer opened this issue Oct 18, 2016 · 5 comments

Comments

@rschaerer
Copy link
Contributor

Using a browser with a locale which has no translated content in the corresponding locale breaks the admin view ⁠⁠⁠⁠/admin/categories

The Content overview looks like this if a Category isn't translated (compared to the last category which has a translation):

admin-view-content

Clicking on a Category shows the following error:

admin-view-content-category

You can manually force helpy to use another locale by appending ?lang=de&locale=de to the url, which is a workaround to this issue. But on every page load or navigation click, the url must be appended again.

admin-view-content-with-lang-and-locale-parameters

@CGA1123
Copy link
Contributor

CGA1123 commented Oct 18, 2016

@rschaerer Could you post the logs for the 500 error?

Is the error by any chance a I18n::InvalidLocale?

@scott
Copy link
Member

scott commented Oct 18, 2016

Also, please give the commit sha you are using, as this looks like a slightly older version- the error page should be branded.

@rschaerer
Copy link
Contributor Author

rschaerer commented Oct 19, 2016

@scott: I'm using the last release, 0.10.2 (bb85865).

@CGA1123: I don't understand what you mean by I18n::InvalidLocale but here's the unicorn log. I hope this is the correct log, therwise ping me.

Started GET "/admin/categories/3" for 31.10.152.195 at 2016-10-19 09:48:42 +0200
Processing by Admin::CategoriesController#show as HTML
  Parameters: {"id"=>"3"}
  User Load (0.4ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["id", 1]]
  Category Load (0.6ms)  SELECT  "categories".* FROM "categories" WHERE "categories"."id" = $1  ORDER BY "categories"."id" ASC LIMIT 1  [["id", 3]]
  Category::Translation Load (0.4ms)  SELECT "category_translations".* FROM "category_translations" WHERE "category_translations"."category_id" = $1  [["category_id", 3]]
  Doc Load (0.5ms)  SELECT "docs".* FROM "docs" WHERE "docs"."category_id" = $1  ORDER BY rank ASC  [["category_id", 3]]
  Doc::Translation Load (0.4ms)  SELECT "doc_translations".* FROM "doc_translations" WHERE "doc_translations"."doc_id" = $1  [["doc_id", 3]]
  Rendered admin/categories/show.html.erb within layouts/admin (14.4ms)
Completed 500 Internal Server Error in 30ms (ActiveRecord: 2.3ms)

ActionView::Template::Error (undefined method `parameterize' for nil:NilClass):
    23:             <ul class="dropdown-menu dropdown-menu-right" role="menu">
    24:               <li><%= link_to t(:edit, default: 'Edit'), edit_admin_category_doc_path(doc.category.id, doc.id, lang: I18n.locale) %></li>
    25:               <li><%= link_to t(:delete, default: 'Delete'), admin_doc_path(doc.id), data: {confirm: t(:delete_confirm, default: 'Please confirm you really want to DELETE this')}, method: :delete, remote: true, class: 'less-important' %></li>
    26:               <li><%= link_to t(:view_on_site, default: 'View on Site'), category_doc_path(doc.category, doc), {target: "_blank"} %></li>
    27:             </ul>
    28:           </div>
    29:         </td>
  app/models/doc.rb:66:in `to_param'
  app/views/admin/categories/show.html.erb:26:in `block in _ce177a558ef8cddc57736ffc64a22b5f'
  app/views/admin/categories/show.html.erb:12:in `_ce177a558ef8cddc57736ffc64a22b5f'

@scott
Copy link
Member

scott commented Nov 19, 2016

@rschaerer are you still experiencing this bug?

@rschaerer
Copy link
Contributor Author

@scott, we have this bug with Version: 1.0.0:2e0430f and I didn't come round to do some more testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants