I installed Votingapi and Rate. I installed Devel. Generated 50 users. Generated 50 content. Attempted to generate votes for that content. Got this Fatal Error:

Fatal error: Call to undefined function drush_get_option() in /home/xxxx/public_html/sites/all/modules/votingapi/votingapi.drush.inc on line 84

I have NOT installed Drush on my shared hosting at this point. Successfully installed latest Drush on my shared hosting after this error. Attempt again. Same fatal error.

This is my line 84 of my votingapi.drush.inc

function votingapi_generate_votes($entity_type = 'node', $vote_type = 'percent', $options = array()) {
module_load_include('inc', 'devel_generate');
$options += array(
'age' => 36000,
'types' => $roles = drush_get_option('types') ? explode(',', drush_get_option('types')) : array(),
'kill' => FALSE,
);

Please help me solve this problem. I've run into many problems in Drupal so far since I started learning it and have been able to figure out every one of them except for this one. Thanks in advance.

Comments

salvis’s picture

Project: Devel » Voting API
Version: 7.x-1.2 » 7.x-2.x-dev
Component: devel_generate » Code

This is Voting API code. Your first address is the Voting API queue.

Please set Version to the version that you're using.

jwalterweatherman’s picture

I'm getting this error as well - although when I click "generate votes" the first time it just resets the page, and when I click it again this error comes up.

jaydub’s picture

Status: Active » Closed (duplicate)
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 admin UI can correctly generate realistically distributed votes for any VotingAPI-based widget, in any configuration.