Like many others I am trying to create a Review node. I have created a node type named Review with a five star filed named cost_rating.
For some reason the node Id that is returned by the target node id code is not being stored in the content_type_review.field_cost_rating_target column.
Here is my test target node id code.
<?php
drupal_set_message('Target node ID: code has been executed.', 'status');
return 10;
?>
The status message is displayed after the review is saved, so I know that the target code is being executed. But the value 10 is NOT stored in the content_type_review.field_cost_rating_target column (0 is stored instead).
However if I just put the number 10 (no php code) in the the target node id field it works, the field_cost_rating_target column is populated correctly.
I have read numerous other posts/issues about cck and fivestar. I have already enabled fivestar for the "target" node. Also I am NOT having an issue with the vote not being stored in the votingapi_vote table, that works fine when the target node id is valid. I just can't get the target node id to be valid when returned by php code.
What is going on here? Why does the "hard coded" node id work, but the php returned node id does NOT work?
I am using the following modules.
drupal 6.x
fivestar 6.x-1.2
votingapi 6.x-2.xdev
cck-6.x-2.o-beta
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | fivestar-target_is_not_stored-283031-11-7.x.patch | 762 bytes | guilopes |
| #10 | Screenshot at 2012-04-19 20:12:28.png | 254.18 KB | Energyblazar |
Comments
Comment #1
welzie commentedI tested this on a drupal5 install I have (with 5.x versions of all the modules listed above). And it worked fine.
I am going to test on a "clean" drupal6 setup and see what happens. It's possible something is broken on the drupal6 setup that I have been testing with.
Comment #2
welzie commentedTried this with drupal 6.3 and it still didn't work.
Also noticed that with these versions I got a "white page of death" when trying to save any node that had a cck five star field.
-drupal 6.3
-cck 6.x-2.x-dev (same result with cck-6.x-2.0-rc4)
-fivestar 6.x-1.12
-votingapi 6.x-2.0-beta6
Once I changed to these versions I had my original bug where the target node id return using php code is not stored.
-drupal 6.3
-cck 6.x-2.0-beta
-fivestar 6.x-1.12
-votingapi 6.x-2.0-beta6
Should this support request be moved to the cck issue area since it involves a cck five star field? I'm really at a loss.
P.S. Is nobody moving to 6.x? I'm new to drupal and would like to start out with the latest version.
Comment #3
quicksketch@welzie, could you try out the 6.x development version? The mechanism for the target NID has changed quite a bit and this problem may already be fixed.
Comment #4
quicksketchI noticed there currently isn't a 6.x dev version package. I created a new release that should be available in the next 12 hours at http://drupal.org/node/286329 (it won't be visible until the packaging script runs next).
You can also checkout a copy of the latest code using CVS.
Comment #5
911 commentedHi,
I had the same Problem. I didnt get Fivestar-6.x-1.12, Nodecomment 6.x-1.2-rc1 and Drupal 6.3 as a review system working. I tried all variations, settings, and custom php codes I found, but still not getting Node Comment Votes be count for the parent Node.
I tried the Fivestar 6.x-1.x-dev land it looks like it is working in the development Pack. Users Votes in the Node Comment as well as the Avarage Voting in the parent Node are displayed correct. The "Node Comment Parent" as "voting target" works great in this Version.
@quicksketch
Will there be a new Stable release (for D6) soon which contains the fixes?
I have noticed another bug:
I have set the voting field as "requiered" for posting a node comment. But the node gets saved even if the voting field is left blank. But I want to force the user to give a vote when he comment. I noticed the same when I used five Star voting for the core comment system as well.
I also noticed I cannot uncheck the "Allow users to undo their votes" checkbox in the fivestar cck field setting. When I uncheck and save, it is be active again. perhaps this is related to this.
Is there any fix for this?
Best Regards
Comment #6
ckngwelzie,
Could be your didn't enclose within
<?php ?>tag?Comment #7
quicksketchThis is probably cause by #262678: Target Node ID is not evaling PHP code, which is fixed in 1.13.
Comment #8
quicksketch1.13 is out. Please upgrade and reopen if this problem exists in the new version.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
Energyblazar commentedJust found out that the problem continues in the latest version of Drupal 7 and the latest development of Fivestar.
If you see the screenshot's properly you will observe "field_users_vote_target" is null.
Even though i tried to set voting target as Parent Node
Also used this patch to target the vote to the author here http://drupal.org/node/1481502
Even tried this out http://drupal.org/node/1488914 to target vote via reference module.
Applied patch mentioned in here http://drupal.org/node/1300766 too, but in vain.
The database value of field_user_vote_target is always null.
What am i missing or not doing ?
Comment #11
guilopes commentedthe module still have this issue, this patch solve it
Comment #12
guilopes commented