From a53f958c78d626b94b316dd0277fd94049f381f1 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 11 Jun 2013 15:43:07 -0400 Subject: [PATCH] Fix error when trying to edit a category with empty slug --- app/assets/javascripts/discourse/routes/application_route.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/routes/application_route.js b/app/assets/javascripts/discourse/routes/application_route.js index af2fc799dde..c47036de6bc 100644 --- a/app/assets/javascripts/discourse/routes/application_route.js +++ b/app/assets/javascripts/discourse/routes/application_route.js @@ -41,7 +41,8 @@ Discourse.ApplicationRoute = Em.Route.extend({ Discourse.Route.showModal(router, 'editCategory', category); router.controllerFor('editCategory').set('selectedTab', 'general'); } else { - Discourse.Category.findBySlugOrId(category.get('slug')).then(function (c) { + Discourse.Category.findBySlugOrId(category.get('slug') || category.get('id')).then(function (c) { + console.log('ok show it now please'); Discourse.Site.instance().updateCategory(c); Discourse.Route.showModal(router, 'editCategory', c); router.controllerFor('editCategory').set('selectedTab', 'general');