mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
FIX: When appending tags to restricted category posts, we need to pass the category id, or it won't work. (#9020)
This commit is contained in:
parent
c9b53d5647
commit
87f15f9ed6
@ -219,6 +219,11 @@ export default Component.extend({
|
||||
}
|
||||
},
|
||||
|
||||
setCategory(category) {
|
||||
this.set("searchedTerms.category", category);
|
||||
this.set("category", category);
|
||||
},
|
||||
|
||||
setSearchedTermValueForCategory() {
|
||||
const match = this.filterBlocks(REGEXP_CATEGORY_PREFIX);
|
||||
if (match.length !== 0) {
|
||||
@ -235,21 +240,21 @@ export default Component.extend({
|
||||
(!existingInput && userInput) ||
|
||||
(existingInput && userInput && existingInput.id !== userInput.id)
|
||||
)
|
||||
this.set("searchedTerms.category", userInput);
|
||||
this.setCategory(userInput);
|
||||
} else if (isNaN(subcategories)) {
|
||||
const userInput = Category.findSingleBySlug(subcategories[0]);
|
||||
if (
|
||||
(!existingInput && userInput) ||
|
||||
(existingInput && userInput && existingInput.id !== userInput.id)
|
||||
)
|
||||
this.set("searchedTerms.category", userInput);
|
||||
this.setCategory(userInput);
|
||||
} else {
|
||||
const userInput = Category.findById(subcategories[0]);
|
||||
if (
|
||||
(!existingInput && userInput) ||
|
||||
(existingInput && userInput && existingInput.id !== userInput.id)
|
||||
)
|
||||
this.set("searchedTerms.category", userInput);
|
||||
this.setCategory(userInput);
|
||||
}
|
||||
} else this.set("searchedTerms.category", "");
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ export default DiscourseRoute.extend({
|
||||
context: {},
|
||||
skip_context: {}
|
||||
},
|
||||
category: null,
|
||||
|
||||
titleToken() {
|
||||
return I18n.t("search.results_page", {
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
{{#if canBulkSelect}}
|
||||
{{d-button icon="list" class="btn-default bulk-select" title="topics.bulk.toggle" action=(action "toggleBulkSelect")}}
|
||||
{{bulk-select-button selected=selected action=(action "search")}}
|
||||
{{bulk-select-button selected=selected category=category action=(action "search")}}
|
||||
{{/if}}
|
||||
|
||||
{{#if bulkSelectEnabled}}
|
||||
@ -211,6 +211,7 @@
|
||||
{{search-advanced-options
|
||||
searchTerm=searchTerm
|
||||
isExpanded=true
|
||||
category=category
|
||||
}}
|
||||
|
||||
{{d-button
|
||||
|
Loading…
x
Reference in New Issue
Block a user