summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-09-05 02:32:58 +0000
committerGo MAEDA <maeda@farend.jp>2024-09-05 02:32:58 +0000
commit9bdce9a821c23336c64ec000fcb3532fbf384353 (patch)
tree04b138d1b67fd652461dc55ad5129fd4fce13af8
parentb4f461cf6571af02e16594fe7258ead3496f6a49 (diff)
downloadredmine-9bdce9a821c23336c64ec000fcb3532fbf384353.tar.gz
redmine-9bdce9a821c23336c64ec000fcb3532fbf384353.zip
Backport r23008 from trunk to 5.1-stable (#41096).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@23014 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--public/javascripts/application.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index fcd9aed54..caf680b6a 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1164,6 +1164,12 @@ function inlineAutoComplete(element) {
if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
$(element).attr('autocomplete', 'off');
}
+ // When triggered with text starting with "##", like "##a", the search term will become "#a",
+ // causing the SQL query to fail in finding issues with "a" in the subject.
+ // To avoid this, remove the first "#" from the search term.
+ if (text) {
+ text = text.replace(/^#/, '');
+ }
remoteSearch(getDataSource('issues') + encodeURIComponent(text), function (issues) {
return cb(issues);
});