Seems like a permissions issue, or not being allowed to create a new field in the db..
Any idea why this is happening?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deeve’s picture

Interesting 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?

fa46’s picture

Subscribing.

deeve’s picture

Category: support » bug

Escalating this issue to a bug.

ashokc’s picture

I 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

deeve’s picture

@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.

ressa’s picture

@ashokc: I am getting this error as well when I try to generate votes. Would you like to share? :-)

Steven Brown’s picture

First 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.

ressa’s picture

I 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.

Steven Brown’s picture

Thank you ressa, now we know what the error is and can move forward :)

mwidner’s picture

I'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.

jwalterweatherman’s picture

I'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.

kurtzhong’s picture

Use the drush command instead, the interface is so weak. See `drush help generate-votes`

kurtzhong’s picture

Here is the patch for the error i met in #7

iStryker’s picture

Title: 500 error when trying to Generate Votes with Fivestar module? » 500 error when trying to Generate Votes with other modules, such as Five star and Rate?
Status: Active » Needs review

Thanks @kurtzhong! Marking as needs review

iStryker’s picture

Status: Needs review » Reviewed & tested by the community

Ok 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

torotil’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

I've commited the patch into 7.x-2.x.

@kurtzhong: thanks for the patch - and to all others for participating.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

galundin’s picture

I 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.inc and votingapi.admin.inc. The new admin UI can correctly generate realistically distributed votes for any VotingAPI-based widget, in any configuration.