Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8423 closed defect (fixed)

No rating for project root page

Reported by: rlrj60 Owned by: rjollos
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 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by anonymous

comment:1 Changed 4 years ago by rjollos

  • Priority changed from normal to high
  • Status changed from new to assigned

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

comment:2 Changed 4 years ago by rjollos

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

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

comment:3 Changed 4 years ago by rlrj60

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 4 years ago by rjollos

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 4 years ago by rjollos

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

(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 4 years ago by rjollos

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.