Edgewall Software
Modify

Ticket #2149 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Redirecting wiki page which ends with '/'

Reported by: Shunichi Goto <gotoh@…> Owned by: cboos
Priority: normal Milestone: 0.10
Component: wiki system Version: devel
Severity: minor Keywords: review
Cc:
Release Notes:
API Changes:

Description

If I request to wiki page url with slash at the end of url (i.e. .../wiki/StartPage/),
trac says "Describe "Start/" here" althou 'StartPage?' is exist.
To allow structured wiki pages, I think it is better that trac treat
".../wiki/StartPage/" page as ".../wiki/Startpage".

Here's a sample patch by using redirection:

  • web_ui.py

     
    7171        action = req.args.get('action', 'view') 
    7272        pagename = req.args.get('page', 'WikiStart') 
    7373        version = req.args.get('version') 
     74        if 1 < len(pagename) and pagename.endswith('/'): 
     75            req.redirect(self.env.href.wiki(pagename[:-1])) 
    7476 
    7577        db = self.env.get_db_cnx() 

Attachments

Change History

comment:1 Changed 6 years ago by Shunichi Goto <gotoh@…>

s/structured/hierarchical/

comment:2 Changed 6 years ago by cboos

  • Owner changed from jonas to cboos
  • Severity changed from normal to minor

I think it's a good idea.

However, it might be surprising, as it's an exception
to the normal rule for explicit wiki page links,
where the WikiPageNames syntax is ignored:
e.g. wiki:About/? would here link to the About wiki page,
instead of the expected "About/" page.

But as I think it would be troublesome to allow creating
a page with an ending "/", it's OK for me. Others?

comment:3 Changed 6 years ago by cboos

  • Keywords review added

#2323 marked as duplicate.

comment:4 Changed 6 years ago by cmlenz

This is a good idea in my opinion. I'd drop the 1 < len(pagename) part from the condition, which isn't needed AFAICT.

comment:5 Changed 6 years ago by cboos

  • Resolution set to fixed
  • Status changed from new to closed

Implemented in r2635.

comment:6 Changed 6 years ago by cboos

  • Milestone set to 1.0

comment:7 Changed 6 years ago by cmlenz

  • Milestone changed from 1.0 to 0.10
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.