View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0010038 | mantisbt | tagging | public | 2009-01-09 17:13 | 2009-04-20 09:49 |
| Reporter | olegos | Assigned To | jreese | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | git trunk | ||||
| Fixed in Version | 1.1.7 | ||||
| Summary | 0010038: Problems attaching tags in Chrome | ||||
| Description | Attaching tags with Google Chrome browser from the View Issue page. In this tracker ("Mantis 1.2.0a2 git snapshot 1feb832"), after attaching a tag, clicking anywhere else (taking focus away from the tags drop-down list) appends a comma to the Attach Tags string. Then selecting another tag from the drop-down list results in a string with two commas in a row (e.g. "install,,error,"). On my own tracker, fairly recent 1.2.0a2 snapshot (svn r5751, with a number of later bugs backported), it's worse: ",Existing tags" gets appended, and a new tag "Existing tags" gets created. The cause seems to be that the onchange action of the tag_select box gets called when focus goes away. I fixed this on my tracker for now by adding if (p_string != '' && p_string != 'Existing tags') around the code in tag_string_append() in javascript/common.js. I think this is a good check to have in any case, to guard against current & future browser brokenness. I wasn't able to figure out the reason for the different behavior between my installation and this one. All relevant files are the same (view.php, core/tag_api.php, javascript/common.js) except for minor formatting changes. Any ideas where else to look? By the way, you should delete "Existing tags" tag on this tracker ( | ||||
| Tags | patch | ||||
| Attached Files | bug10038.patch (803 bytes)
--- common.js.orig 2009-01-13 10:44:41.707409950 -0600
+++ common.js 2009-01-13 10:45:07.667412734 -0600
@@ -156,10 +156,12 @@
t_tag_separator = document.getElementById('tag_separator').value;
t_tag_string = document.getElementById('tag_string');
t_tag_select = document.getElementById('tag_select');
- if ( t_tag_string.value != '' ) {
- t_tag_string.value = t_tag_string.value + t_tag_separator + p_string;
- } else {
- t_tag_string.value = t_tag_string.value + p_string;
+ if (p_string != '' && p_string != t_tag_select.options[0].text) { /* ignore "Existing tags" */
+ if ( t_tag_string.value != '' ) {
+ t_tag_string.value = t_tag_string.value + t_tag_separator + p_string;
+ } else {
+ t_tag_string.value = t_tag_string.value + p_string;
+ }
}
t_tag_select.selectedIndex=0;
}
| ||||
|
I deleted the "Existing tags" tag here. if you want to upgrade, download the latest snapshot from: http://git.mantisbt.org/?p=mantisbt.git;a=shortlog;h=refs/heads/master clicking on the "snapshot" link, so you can check if you're able to get a consistent behavior |
|
|
and BTW, your fix is not going to work for all of your users not using the english language, because that string is translated. |
|
|
Yes, that's where I got the source for the latest version that I was comparing against. I don't want to upgrade just yet -- since it looks like 1.2.0a3 is just around the corner, I'll wait for it. (Since you guys switched from subversion, upgrades became a lot more difficult for me -- I haven't figured out git yet.) English only -- yes, I knew that. My tracker is private and all users use English. And besides, it's trivial to make my fix work for other languages. |
|
|
A patch in a language-independent way for git trunk is attached. |
|
|
Fix committed to 1.1.7 and 1.2.x development trees. |
|
|
I apologize, I wasn't trying to re-open this issue, I was testing something else. This issue can be resolved. |
|
|
MantisBT: master 5061832e 2009-01-13 13:31 Details Diff |
Fix 0010038: Prevent attaching empty tag strings. Fixes problem with Chrome browser generating JS event for 'Existing tags'. |
Affected Issues 0010038 |
|
| mod - javascript/common.js | Diff File | ||
|
MantisBT: master-1.1.x dd91387c 2009-01-13 13:31 Details Diff |
Fix 0010038: Prevent attaching empty tag strings. Fixes problem with Chrome browser generating JS event for 'Existing tags'. |
Affected Issues 0010038 |
|
| mod - javascript/common.js | Diff File | ||
|
MantisBT: master b2a0d81e 2009-01-13 13:31 Details Diff |
Fix 0010038: Prevent attaching empty tag strings. Fixes problem with Chrome browser generating JS event for 'Existing tags'. |
Affected Issues 0010038 |
|
| mod - javascript/common.js | Diff File | ||