Closed (fixed)
Project:
Rate
Version:
7.x-1.0-beta2
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2010 at 01:29 UTC
Updated:
18 Sep 2025 at 13:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bertboerland commentedhi,
this is a very valid requst. Note however that we build this module for our own customers. As long as they do not migrate and we do not need this module in d7, we might be slow on picking this up. In due time this will be done however for sure, jut not when d7.0 will be out.
Comment #2
bertboerland commentedsetting to postponed, will be done in due time
Comment #3
sammyman commentedSubscribing.
Comment #4
willvincent commentedTrying my hand at rolling an initial patch for Drupal 7... this is rolled against cvs head.
It addresses all issues in coder, including formatting issues, aside from two or three false positives.
Probably a bunch more items I'm forgetting, and I'm sure there's most likely a good deal more work going to be needed to port this fully, but it's at least installable.. Haven't tested beyond that yet.
Comment #5
mauritsl commentedMany thanks on that!
Now busy with carols :) But I will review this soon and commit it to a 7.x branch.
Comment #6
willvincent commentedThere are still a lot of problems with this patch.. It installs on d7, but that's the extent of it really.. none of the menu hooks are working as they should, and they don't live within the new d7 admin menu properly. Form callback for the widget types is also broken, it's throwing an error, and returning "Array" rather than a rendered form.
Not sure where to go from here though as I'm not familiar enough with the code or the voting api.
Comment #7
ranavaibhav+1
subscribing
Comment #8
rene bakxSince i figured out, I would need a module like this on a project I'm building the next weekends off, started on the conversion this afternoon, and I'm pretty much done with the admin part of this module.
Rewrote the storage part of the widgets, instead of storing all the widgets in one gigantic serialized array in the variables added a schema to store a single widget in one row of the database.
Moved some things around, and created a few functions to cope with that new table.
Pushed my work so far onto gitorious repo
Will look at your patch tomorrow tcindie, i'm especially interested in your work at the javascript side :)
Comment #9
bertboerland commentedHi Rene, thanks!
Comment #10
rene bakxDon't thank me yet, cause i give up.. the lack of structure in this module is to much for me.
I spend almost an entire morning figuring how i need to set a template and why it can not be in the edit widget way. For me this proves that storing data as serialized arrays is like storing a database inside a database. If it would truly be the CCK of voting, the data model needs to be unserialized and stored in a normal table way. Having a few tables extra in a DB is cheaper then unserialize every widget there is, check if that widget has your current node_type set and then display the voting form.
But that would cost me more time then i have at this moment, and would mean a complete rebuild. Might as well build a new module from scratch then.
If somebody want's to continue with this, feel free to grab my work from the above mentioned gitorious account.
Comment #11
bertboerland commentedthanks for this feedback, will discuss this with maurits
Comment #12
thomas1977 commentedSubscribing. Looking forward to the D7 port being a reality. Thanks, guys!
Comment #13
DomDoze commentedSubscribing. Would love to see this ported.
Comment #14
mauritsl commentedI got pretty far this evening based on the work of tcindie. The backend works, except for the delete checkboxes not playing well with ahah. The frontend still generates tons of errors coming from the part that integrates with votingapi. I will go on with that part on Wednesday, hoping to get a working D7 version this week. No promises yet - will do my best :)
@ReneB: The variables system is indeed a database in a database. I agree that Rate got too complex to store everything in the variables. But it's more important to have a working D7 version imo. I will leave your work for a next version.
Comment #15
bertboerland commentedI have seen a working demo at mau's, so rate will be the first voting module out for d7 it seems ;-)
Comment #16
willvincent commentedThe entire ahah system has changed in d7.. It's changed to #ajax
Randy Fay posted good info about the changes on his site here: http://randyfay.com/ajax
Comment #17
mauritsl commentedA D7 port has been committed. Dev snapshot will be available within 12 hours.
Known issues:
I just did some basic testing. Please test for yourself and post your feedback here.
@tcindie:
In the D6 version you can check the delete checkbox and then click the "Add more options" button. The row with the delete box checked is then deleted. The behavior was different in D7, the row was deleted, but the Nth checkbox remains checked (for another option). I did not manage to get the damn checkbox unchecked, but solved the problem by not deleting the row at all.
Comment #18
mauritsl commentedEuuhm testing needed.. thus "needs review"
Comment #19
mauritsl commentedVote rollover issue is already posted in the VotingAPI issue queue: #997092: Anonymous vote rollover not working
Comment #20
Cheek commentedThanks for the port! However, it's not yet working for me. I can install. Create rate systems. But I can't print anything in my theme.
None of the code examples in the readme.txt show anything. Also, print_r($links); or print_r($results); gives no results.
When I try:
I get:
Fatal error: Call to undefined function node_invoke_nodeapi() in /sites/all/themes/foa/templates/node.tpl.php on line 104
I'm also getting the following error on every page:
WARNING: PARAMETER 1 TO RATE_NODE_VIEW() EXPECTED TO BE A REFERENCE, VALUE GIVEN IN MODULE_INVOKE_ALL() (LINE 817 OF /INCLUDES/MODULE.INC).
Comment #21
willvincent commentedThat issue isn't due to the module being non functional, it's due to you calling a function that no longer exists in d7. ;)
From the docs:
So, that code should be changed to this:
Comment #22
mauritsl commentedThat code also doesn't work. The widget is now in $node->rate_NAME['#markup'] instead of '#value'. But the module_invoke_all() triggers errors in the comment module. To overcome these problems I've created a new function called "rate_embed". The code is now:
Readme is also updated. Code is committed to CVS.
Comment #23
willvincent commentedThis is a cleaner way of handling this anyway I think.. there's probably not any reason to have it be in the nodeapi hook if it's not going to load automatically anyway. :)
Comment #24
mauritsl commentedI had the same thoughts on that at first, but the reason not to do so is that you will depend your theme on a module. This will generate fatal errors (thus wsod's) if you disable the module.
Comment #25
mauritsl commentedThere is a bug in the permissions part.
An anonymous user is not getting a message when he does not have the permission to vote, and when the option "Behaviour when user has no permission to vote" is set to "Redirect to login and show message".
The message is set in the vote callback. Then the user is redirected to /user, this is a separate request. In D7, messages are never displayed on another request for anon users. The way to fix this is to create new page, with message and loginbox, and redirect to that page.
I do not have time to fix this issue this week, so I will release a beta now, mentioning this issue in the release notes.
Comment #26
rene bakxHey Maurits...
I still have the code that untangles the code a little, and storing some extra fields in table to make it easier, and more scalable in sites with many rate widgets and many nodes. What i did was, i kept the serialized data structure, but introduced a rid (rate.id) , and created a link table that linked an rid to nid. And created a little helper function that hooked into node_load to load the rate widgets associated to that specific node. Saved some looping trough all the widget to determine the correct widget(s) for a node.
If you want, I could merge that, with the code you made for actually showing the widgets on the front screen.
Cause that's where I got stuck, and ran out of time to port the rate module to 7 (instead I quickly ported the plus1 module, cause that was the widget I was looking for, so technically Bert is not correct on having the first working vote system ;))
Have to commit it back to you via a patch, since I did not get my CVS access on d.o, or possible trough github/gitorious?
Comment #27
kansaj commentedI still cannot get rid form the message
Warning: Parameter 1 to rate_node_view() expected to be a reference, value given in module_invoke_all() (line 817 of .../includes/module.inc).
and it prevents from showing the widget.
Comment #28
mauritsl commented@kansaj:
The rate_node_view function indeed expects a reference. This is not a technical requirement, so I think we should remove the ampersand there.
Can you please tell me if the patch attached solves your problem?
Comment #29
kansaj commentedWith #28 now everything works fine !
Tnx
Comment #30
mauritsl commentedPatch is committed to CVS.
Comment #31
mauritsl commentedBug in permissions part (comment #25) is now fixed.
I solved this issue by creating a new menu callback, which sets the message and shows the login page (using user_page()). Advantage is that this also works with aggressive caching, D6 version don't, so maybe I will backport this.
Beta 2 is now released, containing this fix and patch from #28.
Comment #32
Anonymous (not verified) commentedI have just installed the module... added a couple of widget types and enabled them on all node types and comments...
And yet... When I try to add a rating field to my comment forms... there is no 'rate' field type under 'select a field type'... or in fact any field type which will allow me to select the Rate widgets...
I am a beginner... so be kind - but am I missing something blindingly obvious?
D7 latest release
Comment #33
zrice57 commentedI installed the drupal 7 beta2 version onto my site. Everyting works but when I try to click on a vote option it doesn't load the vote.
I have to copy and paste the url of the vote button into the address bar for it to work.
i have tried on multiple computers with multiple browsers and they all have the same problem
Comment #34
mauritsl commented@fineale_uk: The rate widgets can be configured under admin/structure/rate. More info is provided in the readme file.
@zrice57: Thanks for the report. It is also reported as a separate issue: #1042216: Can't click to vote on IE8. Please track that issue for this problem.
I'm setting the status for this ticket to fixed, as the D7 version is available. All issues with this release should have their own ticket.
Comment #37
ivnish