FIX: show 404 page for links to categories that don't exists or you don't have access to, instead of showing blank page with js errors
This commit is contained in:
parent
b4b992299d
commit
12a0260a8c
|
@ -99,6 +99,11 @@ function buildCategoryRoute(filter, params) {
|
||||||
},
|
},
|
||||||
|
|
||||||
afterModel: function(model, transaction) {
|
afterModel: function(model, transaction) {
|
||||||
|
if (!model) {
|
||||||
|
this.replaceWith('/404');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var self = this,
|
var self = this,
|
||||||
noSubcategories = params && !!params.no_subcategories,
|
noSubcategories = params && !!params.no_subcategories,
|
||||||
filterMode = "category/" + Discourse.Category.slugFor(model) + (noSubcategories ? "/none" : "") + "/l/" + filter,
|
filterMode = "category/" + Discourse.Category.slugFor(model) + (noSubcategories ? "/none" : "") + "/l/" + filter,
|
||||||
|
|
Loading…
Reference in New Issue