Note: This is a summarized review and may or may not be split into different issues, or dismissed completely.
a) There is a configuration option to limit the amount of votes per user. However, there's no lifetime restriction, and from a quick peek votes on already closed issues are not subtracted from the user's total votes. Hence, a user has effectively only the configured amount of votes. To move a vote to a new issue, a user seems to have to remove her votes from a previous issue first. Two options: Either we automatically subtract votes on closed (fixed/won't fix) issues. Or we add a configurable time-frame for placing new votes, i.e. each user gets 5 votes per month. Personally, I'd prefer the former.
b) A user can place more than one vote on a single issue. IMO this is not required and we should stick with a simple Digg-style voting method, i.e. just flag issues. That way, a possible correlation to "subscribing" to an issue or just saying "+1" / "me too" is more intuitive, and this would directly follow the unofficial +1 voting mechanism we are used to already. As a result, the voting widget would be much more simple. (I found it very confusing the first time I saw it on p.d.o) Also, the issue votes by user table (http://project.drupal.org/user/54136/project-issue-votes) could be greatly cleaned-up.
c) in correlation with a) Performance will definitely be an issue on d.o. A possible option would be to delete all votes on issues that have been closed, effectively freeing up database indexes and speeding up table scans. I don't think we'll ever have a use-case for this data later on.
d) The list of voted issues could effectively turned into a list of "subscribed" issues this way - by turning the issue votes by user table (http://project.drupal.org/user/54136/project-issue-votes) into a ordinary issue table (http://project.drupal.org/project/issues) and ordering it the usual way (by last updated time).
e) Minor: Code clean-up in some places required, and for performance reasons, Panels + Views integration should probably be moved into a separate sub-module (not (yet) enabled on d.o).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 328648_code_cleanup_rejected_hunks.5.patch | 1.61 KB | dww |
| #4 | project_issue_voting-HEAD.patch | 31.76 KB | sun |
| #1 | Picture 1.png | 9.1 KB | greggles |
Comments
Comment #1
gregglesFor me "b" seems like a feature not a bug. If I want to put 100% of my votes on a single issue I think I should be able to. The voting widget makes complete sense to me as it is (screenshot attached where I've voted for an issue 3 times and have 2 votes left).
Comment #2
dwwThanks for the review. My replies...
a) That's by design. We discussed this in depth with Acquia when they were sponsoring this module. You should manually reclaim your votes. Otherwise, all votes on an issue can be lost by a careless user setting it to "closed" prematurely, etc. Plus, it gives you the nice feeling of visiting the "issues I voted on page" and seeing a bunch of things marked "closed" as a sense of accomplishment.
b) Again, by design. If I only care about 1 issue with all my might, I should be able to indicate that. This isn't just a "i'll sprinkle votes wherever I feel like it so they don't mean anything" feature, this is a way for users to add weighting to the issues they most care about. b.2) "issue votes by user table" should be a view, but we ran out of time/funding for that, and Acquia didn't think it was important.
c) I don't think that necessarily helps performance, and it defeats the purpose of (a).
d) see b.2 above. ;) Yes, this should be a view. A patch to do this would be welcome (or funding -- I'd happily do it myself)
e) "Code clean-up in some places required" isn't helpful. ;) I was pretty careful about this when reviewing hunmonk's original version of the code. Can you please be specific?
"for performance reasons, Panels + Views integration should probably be moved into a separate sub-module " -- they're already in conditionally loaded .inc files. The only cost if you don't have either module enabled is parsing the following code:
The cost of putting these in a whole separate module far outweighs the cost of parsing these 3 trivial functions.
Comment #3
dwwLet's move discussion of user/N/project-issue-votes over to #328689: Convert user/N/project-issue-votes into a view.
Seems like the only other thing in here is the vague "minor code cleanup" mentioned in (E) of the original issue, and I don't know what that means, so I'm setting this to NMI.
Comment #4
sunThis is why I love coder_format.
At least 50% of this patch done automatically.
Comment #5
dwwCool, thanks, that's more helpful. I'm laughing because more than one of these hunks are things I pointed out to hunmonk when I first reviewed his draft of the module, but I guess they never made it into the final code. ;)
A) Attached is a file containing the patch hunks I didn't apply -- I don't think they help readability of the code, and they're not mandated by the coding standards.
B) I didn't apply the patches against views.inc and panels.inc -- until panels and views export code that conforms to our coding standards, I think it's better to leave this stuff as close to the autogenerated output as possible, so that if you modify something, re-export it, and put it in place, you just the diff of what you changed, not all the code style changes, too.
C) In a few cases, I re-worded the first line of the PHPdoc to stay within 80 chars but still be a single line on its own as a summary for IDE users, etc.
Otherwise, I applied all the hunks, did some light testing, and committed to HEAD. Thanks.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.