Closed (fixed)
Project:
Voting API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2011 at 22:41 UTC
Updated:
22 May 2013 at 21:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
deeve commentedInteresting development; I thought to delete all nodes of the content type I wish to permit voting on, thinking this may then allow the db to accept an additional column. Flushed the Cache & tried the 'Generate Votes' function again but this had no effect other than as before:
When I go: Index > Voting API > Generate Votes - I see the dialogue within the Admin overlay view. However, when I select node type & hit 'Do It!' I then get bumped to an Admin view without the overlay. I then try to perform the same task in this view & I receive the Server 500 error.
Am I supposed to use Voting API's 'Generate Votes' when using 'Fivestar' or does that module have its own db write access?
Comment #2
fa46 commentedSubscribing.
Comment #3
deeve commentedEscalating this issue to a bug.
Comment #4
ashokc commentedI modified the file 'votingapi.drush.inc' to get this to work via drush. There seem to be 2 issues. The API says the option to specify node types is '--node_types'. But the code is trying to fetch the option 'types'. Later the '$roles' is being populated with this array of node types (for which to generate votes), but is passing the undefined '$node_types' as the array to filter condition to the query. Also I changed '$entity->{$entity_id_column}' to '$entity[$entity_id_column].
That seemed to do the trick - at least to get this generate votes with drush.
- ashok
Comment #5
deeve commented@ashokc: Nice work! Sorry, I didn't understand which code you changed regarding the 'node_types' discrepancy - could you please explain a bit more?
Thanks.
Comment #6
ressa@ashokc: I am getting this error as well when I try to generate votes. Would you like to share? :-)
Comment #7
Steven Brown commentedFirst and foremost we should determine that this error is truly due to the Voting API module. The way I would go about this is to uninstall the fivestar module and install isuseful or plus1. If you are getting the same error for each of those then we can continue down this path.
Also the current fix for drush that ashokc has supplied is only a fix for command line. Sounds like we still might have a problem even after the testing.
Comment #8
ressaI reproduced the error with the Rate module: Uninstalled the Fivestar module and installed the Rate module, enabled "Thumbs up down" for the content type, tried to generate votes for that content type and got the same error "Fatal error: Call to undefined function drush_get_option() in /var/www/drupal7/sites/all/modules/votingapi/votingapi.drush.inc on line 84". So it seems like Fivestar module isn't the cause.
Comment #9
Steven Brown commentedThank you ressa, now we know what the error is and can move forward :)
Comment #10
mwidner commentedI'm experiencing the same issue with a clean install of Drupal 7.17, Votingapi 7.x-2.10, Rate 7.x-1.5, and Devel 7.x-1.3.
Comment #11
jwalterweatherman commentedI'm experiencing the same issue, identical setup to mwidner. Has anyone figured out how to solve this since last year? I've given it a shot a number of times, but always fall short.
Comment #12
kurtzhong commentedUse the drush command instead, the interface is so weak. See `drush help generate-votes`
Comment #13
kurtzhong commentedHere is the patch for the error i met in #7
Comment #14
istryker commentedThanks @kurtzhong! Marking as needs review
Comment #15
istryker commentedOk I can confirm this patch fixes the 500 server error. Patch applies cleanly.
I think vote generate needs alot of work. Its pretty ugly. But thats for another issue
Comment #16
torotil commentedI've commited the patch into 7.x-2.x.
@kurtzhong: thanks for the patch - and to all others for participating.
Comment #18
galundin commentedI overhauled the vote generation code for 7.x-2.x. It is now feature-complete for all of VotingAPI's capabilities. I created a new issue for the rewrite:
#2001090: Allow more control over votes generated using devel generate
There you will find drop-in replacements for
votingapi.drush.incandvotingapi.admin.inc. The new admin UI can correctly generate realistically distributed votes for any VotingAPI-based widget, in any configuration.