Allow custom unpublished states in Fivestar CCK field

crea - October 11, 2009 - 13:02
Project:Fivestar
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Fivestart CCK casts zero votes (effectively resetting them) when review node (i.e. containing fivestar field) is unpublished with status=0. This works for simple setups but there are problems for advanced uses. Add workflow module with node access and you will have situation where review node must always have status=1 (i.e. be published in Drupal core terms) for node access rules to apply. Then you have broken voting because reviews that did not pass moderation yet already cast their votes. I think everyone who has good knowledge of Drupal knows that $node->status has just poor implementation in Drupal and many advanced setups include additional means to flag node as "published".

I think there must be some means to control if vote should be cast depending on review node state. What about some custom hook ?

#1

crea - October 11, 2009 - 14:12
Status:active» needs review

Attached patch adds support for hook_fivestar_field_vote_alter() and is generally safe. Alteration happens in fivestar_field() because information about review node is not passed into _fivestar_vote_cast().

AttachmentSize
fivestar-field-vote-alter.patch 662 bytes

#2

crea - October 11, 2009 - 14:14
Title:Fivestar CCK field vote casting should be more configurable» Allow custom unpublished states in Fivestar CCK field
 
 

Drupal is a registered trademark of Dries Buytaert.