Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Use the default Drupal theme.
Create a review type with two axes, associate it to a custom node type "Hotel" and fill in a first review for a given hotel.
Display the reviewed hotel node.
The node shows "Total Reviews: 1", which is ok.
But it shows "Average Review Rating:" with no value displayed, even if I set values to both axes of the review filled in.
Comment | File | Size | Author |
---|---|---|---|
#5 | nodereview-average_review_rating_field_extra-1514448-5.patch | 4.26 KB | h3rj4n |
#3 | nodereview-average_review_rating_empty_fix-1514448-3.patch | 3.06 KB | h3rj4n |
Comments
Comment #1
emptymalei CreditAttribution: emptymalei commentedSame issue encountered.
Comment #2
ICThawk CreditAttribution: ICThawk commentedI have totally ripped apart this module. This was one of the issues I had to fix.
To fix this yourself open the nodereview.module file.
at line 407 you'll see
The problem is there is no call to display the actual percentage. Add that in by replace that line with this line:
I also made it so users can review as many times as they want. I removed all instances of the text box to the questions. Also made it so the "short comment" is now a timestamp and prefilled in with the current date&time. Now users can quickly click each rating rating and submit without ever typing. Perfect for touchscreen usage (which I am designing this for).
Comment #3
h3rj4n CreditAttribution: h3rj4n commentedI rewrote the hook_node_view a bit. It now uses the functions provided by voting api to get the votes on the node. I guess by applying this patch the support for Vote API 1.x is over.
This patch contains part of ITChawk solution.
Comment #4
jay.lee.bio CreditAttribution: jay.lee.bio commentedI don't think the patch works. No matter what I do, "Average Review Rating" always says 1. I also just noticed that the "Total Reviews" is also inaccurate, where most of the time it'll say 1, but one of them says 30 when I only have 1 for that node?!?
P.S. I'll retest the patch after I'm done with all the other ones...
Comment #5
h3rj4n CreditAttribution: h3rj4n commentedThis isn't the fix. Only a small update on what I'm working on.
I implemented hook_field_extra_fields so that you can change the location of the 'Average Review Rating'. You can even remove it from the node view. Haven't looked into your problem yet Jay.
Comment #6
jay.lee.bio CreditAttribution: jay.lee.bio commentedOh ok. Well at least the field itself is no longer empty. I didn't notice anything different from #3 after applying #5 though, meaning I don't see anywhere that let's me "change the location of the 'Average Review Rating'." I don't know where I can "remove it from the node view" either. But I'll let you continue updating your patch as I'm sure it'll become more clear to me as it gets refined. :D
Comment #6.0
jay.lee.bio CreditAttribution: jay.lee.bio commentedAdded "Use the default Drupal theme."