diff --git a/ghost/admin/app/controllers/posts.js b/ghost/admin/app/controllers/posts.js index 4ee85ea2d7..4632edb695 100644 --- a/ghost/admin/app/controllers/posts.js +++ b/ghost/admin/app/controllers/posts.js @@ -65,12 +65,12 @@ export default Controller.extend({ selectedType: computed('type', function () { let types = this.get('availableTypes'); - return types.findBy('value', this.get('type')); + return types.findBy('value', this.get('type')) || {value: '!unknown'}; }), selectedOrder: computed('order', function () { let orders = this.get('availableOrders'); - return orders.findBy('value', this.get('order')); + return orders.findBy('value', this.get('order')) || {value: '!unknown'}; }), _availableTags: computed(function () { @@ -82,7 +82,6 @@ export default Controller.extend({ .filter(tag => tag.get('id') !== null) .sort((tagA, tagB) => tagA.name.localeCompare(tagB.name, undefined, {ignorePunctuation: true})); let options = tags.toArray(); - options.unshiftObject({name: 'All tags', slug: null}); return options; @@ -92,7 +91,7 @@ export default Controller.extend({ let tag = this.get('tag'); let tags = this.get('availableTags'); - return tags.findBy('slug', tag); + return tags.findBy('slug', tag) || {slug: '!unknown'}; }), _availableAuthors: computed(function () { @@ -112,7 +111,7 @@ export default Controller.extend({ let author = this.get('author'); let authors = this.get('availableAuthors'); - return authors.findBy('slug', author); + return authors.findBy('slug', author) || {slug: '!unknown'}; }), actions: { diff --git a/ghost/admin/app/templates/components/gh-contentfilter.hbs b/ghost/admin/app/templates/components/gh-contentfilter.hbs index 4cf0012e79..0fe89690d0 100644 --- a/ghost/admin/app/templates/components/gh-contentfilter.hbs +++ b/ghost/admin/app/templates/components/gh-contentfilter.hbs @@ -13,7 +13,7 @@ data-test-type-select="true" as |type| > - {{type.name}} + {{#if type.name}}{{type.name}}{{else}}Unknown type{{/if}} {{/unless}} @@ -32,7 +32,7 @@ data-test-author-select="true" as |author| > - {{author.name}} + {{#if author.name}}{{author.name}}{{else}}Unknown author{{/if}} {{/unless}} @@ -52,7 +52,7 @@ data-test-tag-select="true" as |tag| > - {{tag.name}} + {{#if tag.name}}{{tag.name}}{{else}}Unknown tag{{/if}} {{/unless}} @@ -69,6 +69,6 @@ @data-test-order-select="true" as |order| > - {{order.name}} + {{#if order.name}}{{order.name}}{{else}}Unknown{{/if}} \ No newline at end of file