Ticket #8423 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

No rating for project root page

Reported by: rlrj60 Assigned to: 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

changeset_1689.diff (1.3 kB) - added by anonymous on 01/20/11 01:49:55.

Change History

01/20/11 01:49:55 changed by anonymous

  • attachment changeset_1689.diff added.

01/20/11 02:58:16 changed by rjollos

  • status changed from new to assigned.
  • priority changed from normal to high.

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

01/20/11 03:20:06 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

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

01/20/11 18:18:34 changed by rlrj60

  • status changed from closed to reopened.
  • resolution deleted.

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'

01/20/11 22:25:31 changed by rjollos

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

01/20/11 22:47:32 changed by rjollos

  • status changed from reopened to closed.
  • resolution set to fixed.

(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.

01/20/11 22:49:51 changed by rjollos

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


Add/Change #8423 (No rating for project root page)




Change Properties
Action