Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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 Remy Blank, 14 years ago

Keywords: needinfo added

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?

comment:2 by shesek, 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 Remy Blank, 14 years ago

Milestone: 0.12.1
Owner: set to Remy Blank
Priority: normallow
Severity: normalminor

Good detective work! I can reproduce it here:

This is probably a small issue with the expansion JavaScript.

comment:4 by shesek, 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 Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Works great, applied in [10010]. Thanks!

comment:6 by Remy Blank, 14 years ago

Owner: changed from Remy Blank to shesek

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain shesek.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from shesek to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.