Modify

Opened 15 years ago

Closed 8 years ago

#6009 closed defect (fixed)

[Patch] fix link to source if wiki page name contains /

Reported by: michael-dev@… Owned by: ichael-dev@…
Priority: normal Component: IncludeSourcePartialPlugin
Severity: normal Keywords:
Cc: Massimo Trac Release: 0.11

Description

If the wiki page name contains one or more / , then relative url generated in includeSource pointing to the source code does not work anymore. Using the formatter is the preferred way to generate links in trac anyway. Please find a patch attached.

Attachments (2)

fix-browser-url.diff (975 bytes) - added by anonymous 15 years ago.
Use trac url formatter to generate link to source.
fix-browser-url.2.diff (902 bytes) - added by anonymous 15 years ago.
Use trac url formatter to generate link to source.

Download all attachments as: .zip

Change History (8)

Changed 15 years ago by anonymous

Attachment: fix-browser-url.diff added

Use trac url formatter to generate link to source.

Changed 15 years ago by anonymous

Attachment: fix-browser-url.2.diff added

Use trac url formatter to generate link to source.

comment:1 Changed 15 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed
Summary: fix link to source if wiki page name contains /[Patch] fix link to source if wiki page name contains /

comment:2 Changed 8 years ago by Ryan J Ollos

Cc: Massimo added; Ryan J Ollos removed
Owner: changed from Chris Heller to Ryan J Ollos
Status: newaccepted

comment:3 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 15745:

0.3: Properly construct the href

Patch by ichael-dev@….

Fixes #6009.

comment:4 Changed 8 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to ichael-dev@…

comment:5 in reply to:  3 Changed 8 years ago by ebouaziz@…

Resolution: fixed
Status: closedreopened

Replying to rjollos:

In 15745:

0.3: Properly construct the href

Patch by ichael-dev@….

Fixes #6009.

There is an error in this fix line 124, rev must be provided as rev=rev otherwise the generated browser link is incorrect (the revision number is appended to the URL instead of being passed as a parameter)

  • includesource/IncludeSource.py

    a b class IncludeSourceMacro(WikiMacroBase): 
    121121        if kwargs.has_key('header'):
    122122            header = kwargs.get('header')   # user specified header
    123123        else:
    124             header = tag.a(file_name, href=href.browser(orig_file_name, rev))
     124            header = tag.a(file_name, href=href.browser(orig_file_name, rev=rev))
    125125        if not header:
    126126            header = u'\xa0'    # default value from trac.mimeview.api.py
    127127

comment:6 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: reopenedclosed

In 15931:

0.4: Pass rev as parameter

Fixes a regression in r15745.

Patch by ebouaziz@…

Fixes #6009.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ichael-dev@….
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.