#9548 closed defect (fixed)
Source browser: First character missing in hash for repo name
Reported by: | shesek | Owned by: | shesek |
---|---|---|---|
Priority: | low | Milestone: | 0.12.1 |
Component: | version control/browser | Version: | 0.12rc1 |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I'm using multiple repositories (using the [repostiroies] section of trac.ini) In the source browser, the regular links (<a href>) to folder/files is: http://.../myproject/browser/kohana
While the hash portion of the URL that changes using javascript when I click the arrow is: http://trac.kelso/humaninternals/browser/#ohana
notice the "k" of "kohana" is missing from the hash. ("kohana" being the repository name)
This causes those links not to work properly. Manually adding "m" to them does work
Attachments (0)
Change History (6)
comment:1 by , 14 years ago
Keywords: | needinfo added |
---|
comment:2 by , 14 years ago
Keywords: | needinfo removed |
---|
I just tried it again and noticed that it only happens under a very specific case - when I add a suffix of "/" to the URL (was tricky to figure it out, I thought I imagined it the first time I encountered it :)
This works fine, without the bug I described: http://trac.kelso/humaninternals/browser
But when going to this URL, the bug occurs: http://trac.kelso/humaninternals/browser/
Its not that critical as Trac itself always links to the suffixless version that works fine, but might still be worth fixing for those who do use the suffixed URL for some reason (like me).
comment:3 by , 14 years ago
Milestone: | → 0.12.1 |
---|---|
Owner: | set to |
Priority: | normal → low |
Severity: | normal → minor |
Good detective work! I can reproduce it here:
- Go to browser/
- Expand
trunk
using the arrow - The URL becomes: http://trac.edgewall.org/browser/#runk
This is probably a small issue with the expansion JavaScript.
comment:4 by , 14 years ago
The issue seems to be at chrome/common/js/expand_dir.js:
a.attr("href") .substr(window.location.pathname.length+1) .replace(/([^?]*)(\?.*)?$/, '$1');
It expects the current pathname to be contained in the <a>'s href, and removes it in order to get the remainder that should be set as the hash.
a.attr("href") .substr(window.location.pathname.replace(/\/+$/,'').length+1) .replace(/([^?]*)(\?.*)?$/, '$1');
Should fix this by simply trimming out extra slashes before calculating its length.
comment:5 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Works great, applied in [10010]. Thanks!
comment:6 by , 14 years ago
Owner: | changed from | to
---|
It seems to work here on t.e.o, so this could be browser-specific. What browser and OS are you using? Can you reproduce the issue with another browser?