Skip to content

Commit

Permalink
Repair issue count
Browse files Browse the repository at this point in the history
* Still a partial bug fix... this entire slug methodology still needs to be refactored which is going to be lengthy.
* Surprised no one noticed, including me until now, that issue counts were all zero on the badge.

Followup from OpenUserJS@1f82419

Applies to OpenUserJS#819, OpenUserJS#200, and

Originally applies to OpenUserJS#262 ... not part of OpenUserJS#262 (comment)
  • Loading branch information
Martii committed Nov 25, 2015
1 parent 2c25da0 commit bde55db
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions controllers/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ exports.list = function (aReq, aRes, aNext) {

// Show the number of open issues
scriptOpenIssueCountQuery = Discussion.find({
category: script.issuesCategorySlug,
category: decodeURIComponent(script.issuesCategorySlug),
open: { $ne: false }
});
tasks.push(countTask(scriptOpenIssueCountQuery, options, 'issueCount'));
Expand Down Expand Up @@ -292,7 +292,7 @@ exports.view = function (aReq, aRes, aNext) {

// Show the number of open issues
scriptOpenIssueCountQuery = Discussion.find({
category: script.issuesCategorySlug,
category: decodeURIComponent(script.issuesCategorySlug),
open: { $ne: false }
});
tasks.push(countTask(scriptOpenIssueCountQuery, options, 'issueCount'));
Expand Down
2 changes: 1 addition & 1 deletion controllers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var getScriptPageTasks = function (aOptions) {

// Show the number of open issues
scriptOpenIssueCountQuery = Discussion.find({ category: scriptStorage
.caseSensitive(script.issuesCategorySlug, true), open: {$ne: false} });
.caseSensitive(decodeURIComponent(script.issuesCategorySlug), true), open: {$ne: false} });
tasks.push(countTask(scriptOpenIssueCountQuery, aOptions, 'issueCount'));

// Show the groups the script belongs to
Expand Down
2 changes: 1 addition & 1 deletion controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ exports.editScript = function (aReq, aRes, aNext) {

// Show the number of open issues
scriptOpenIssueCountQuery = Discussion.find({ category: scriptStorage
.caseSensitive(script.issuesCategorySlug, true), open: {$ne: false} });
.caseSensitive(decodeURIComponent(script.issuesCategorySlug), true), open: {$ne: false} });
tasks.push(countTask(scriptOpenIssueCountQuery, options, 'issueCount'));

//---
Expand Down

0 comments on commit bde55db

Please sign in to comment.