Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#8423 closed defect (fixed)

No rating for project root page

Reported by: rlrj60 Owned by: Ryan J Ollos
Priority: high Component: FiveStarVotePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

FiveStars don't show up in the root page. For example if a project page is foo at example.com, then the root page at the following base_url does not have the rating stars: http://www.example.com/foo

The URL is equivalent to http://www.example.com/foo/wiki/wikiStart page. This was caused by a limitation in voteable_paths:

voteable_paths = ListOption('fivestarvote', 'paths', '/wiki*,/ticket*', 

My suggestion is to add '/$' to the voteable_paths to allow the FiveStars to show up in the root page.

voteable_paths = ListOption('fivestarvote', 'paths', '/$', '/wiki*,/ticket*', 

Though a small modification is required to map the root page to the wikiStart page:

# Special-case start page with "/" or "/wiki" 
if resource == '' or resource == 'wiki': 
    resource = 'wiki/WikiStart'

Attached is a complete patch. Thanks for creating such a cool plugin.

Attachments (1)

changeset_1689.diff (1.3 KB) - added by anonymous 14 years ago.

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by anonymous

Attachment: changeset_1689.diff added

comment:1 Changed 14 years ago by Ryan J Ollos

Priority: normalhigh
Status: newassigned

Thanks for the patch. I'm testing it now.

comment:2 Changed 14 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

(In [9777]) Match the url '/' to '/wiki/WikiStart' in the default voteable_paths. Fixes #8423.

comment:3 Changed 14 years ago by rlrj60

Resolution: fixed
Status: closedreopened

Thanks for the fix. I really like your new matching regex. Though, the following statements don't work for http://www.example.com/foo because '' + '/WikiStart' will map the URL to a new page http://www.example.com/foo/WikiStart which does not exist.

if not resource or resource == 'wiki': 
    resource += '/WikiStart'

The following work fine:

if not resource or resource == 'wiki': 
    resource = 'wiki/WikiStart'

comment:4 Changed 14 years ago by Ryan J Ollos

Thanks for catching that. I'm not sure how I could have overlooked that in testing yesterday. Fix will be committed shortly.

comment:5 Changed 14 years ago by Ryan J Ollos

Resolution: fixed
Status: reopenedclosed

(In [9783]) Following [9777], a vote on / was still not being registered against wiki/WikiStart. Thanks for rlrj60 for the catch and fix. Fixes #8423.

comment:6 Changed 14 years ago by Ryan J Ollos

The initial patch has a suggested change to the paths option which is being handled in #8426.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.