The error popup says:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /activedoc/system/ajax
StatusText: Internal Server Error
ResponseText:

Apache error log days:

PHP Fatal error: Class name must be a valid object or a string in /srv/www/htdocs/drupal7/includes/common.inc on line 7618, referer: *******

Comments

Michele Wickham’s picture

There is a new build - 7.x-3.x - let me know if this one addresses the problem. I was not able to reproduce the error, but my suspicion is that the form was not rendered as markup properly.

Michele Wickham’s picture

Assigned: Unassigned » Michele Wickham
Status: Active » Needs review
Michele Wickham’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Michele Wickham’s picture

Status: Needs review » Closed (fixed)

Assuming this issue has been resolved. Create a new bug report if not.

gaxze’s picture

Still occuring for me using 7.x-3.x-dev.

After uninstalling voting rules - this error went away.

so issue is with voting rules?!

adam_b’s picture

Same as GaxZE - uninstalled Voting Rules and the error disappeared. Unfortunately, Voting Rules is what I wanted... :(
I've reported this in #1810474: Ajax error with Advanced Poll

kappaluppa’s picture

The other post goes on to describe more here https://drupal.org/node/1810836 but I still don't see it as fixed. But definitely sounds like its the Voting Rules issue.

jordanmagnuson’s picture

I don't have Voting Rules installed, but I am seeing this problem.

cchoudhary’s picture

Same as GaxZE and adam_b, i am also getting same error. I need both advanced poll and and voting rules module be working, but having difficulty in fixing this issue.
solutions suggested in https://drupal.org/node/1810836 were also not helpful.

vsavovski’s picture

Issue summary: View changes

I'm not sure I'm heading in right direction, but as far as I could trace this, it looks like that advpoll module is presenting it's self as entity rather than bundle of node entity. If you take a look here: http://cgit.drupalcode.org/advpoll/tree/advpoll.module?h=7.x-3.x#n745 and later here: http://cgit.drupalcode.org/advpoll/tree/includes/advpoll_voteapi.inc?h=7... you'll notice that.

While this works for advpoll module, it doesn't work for voting_rules, because voting_rules actually expects real entity type here. I haven't tried to replace line: http://cgit.drupalcode.org/advpoll/tree/advpoll.module?h=7.x-3.x#n739 with 'node' instead of 'advpoll', but I have used this as temporary solution:

function hook_entity_info_alter(&$entity_info) {
	$name = 'advpoll';

  $entity_info[$name] = array(
	  'label' => t('AdvPoll'),
    'controller class' => 'NodeController',
    'base table' => 'node',
    'revision table' => 'node_revision',
    'uri callback' => 'node_uri',
	  'fieldable' => TRUE,
	  'entity keys' => array(
      'id' => 'nid',
      'revision' => 'vid',
      'bundle' => 'type',
      'label' => 'title',
      'language' => 'language',
	  ),
    'bundles' => array(),
	);

// Merge in default values.
  $entity_info[$name] += array(
    'fieldable' => FALSE,
    'controller class' => 'DrupalDefaultEntityController',
    'static cache' => TRUE,
    'field cache' => TRUE,
    'load hook' => $name . '_load',
    'bundles' => array(),
    'view modes' => array(),
    'entity keys' => array(),
    'translation' => array(),
  );
  $entity_info[$name]['entity keys'] += array(
    'revision' => '',
    'bundle' => '',
  );
  foreach ($entity_info[$name]['view modes'] as $view_mode => $view_mode_info) {
    $entity_info[$name]['view modes'][$view_mode] += array(
      'custom settings' => FALSE,
    );
  }
  // If no bundle key is provided, assume a single bundle, named after
  // the entity type.
  if (empty($entity_info[$name]['entity keys']['bundle']) && empty($entity_info[$name]['bundles'])) {
    $entity_info[$name]['bundles'] = array($name => array('label' => $entity_info[$name]['label']));
  }
  // Prepare entity schema fields SQL info for
  // DrupalEntityControllerInterface::buildQuery().
  if (isset($entity_info[$name]['base table'])) {
    $entity_info[$name]['schema_fields_sql']['base table'] = drupal_schema_fields_sql($entity_info[$name]['base table']);
    if (isset($entity_info[$name]['revision table'])) {
      $entity_info[$name]['schema_fields_sql']['revision table'] = drupal_schema_fields_sql($entity_info[$name]['revision table']);
    }
  }
}

paulihuhtiniemi’s picture

As said in #10, Advanced Poll specifies entity type as "advpoll" where it should be node when using votingapi. Here's a patch that fixes this.

paulihuhtiniemi’s picture

There were more places, where entity type was wrong.

paulihuhtiniemi’s picture

In function advpoll_user_eligibility() $node->type was used instead of entity type, updated patch.

jordanmagnuson’s picture

Great catch Paul: your latest patch seems to solve the problem. The change seems to make the old poll data inaccessible, though (all my old polls are now showing 0 votes)... I assume something to do with the way voting api works?

Anyway, will continue to test and let you know if I find any further issues...

tripper54’s picture

Status: Closed (fixed) » Needs review
tripper54’s picture

tripper54’s picture

Status: Needs review » Needs work

Thanks for finding and fixing these errors.

We'll need an update function to change the entity_type value on each existing vote from 'advpoll' to 'node', otherwise the existing votes won't tally properly.

tripper54’s picture

Status: Needs work » Needs review
StatusFileSize
new6.82 KB

Added update function to correct the entity type value for already cast votes.

jordanmagnuson’s picture

Status: Needs review » Reviewed & tested by the community

I think #18 is what we're looking for -- worked great on my site. Thanks tripper54!

tripper54’s picture

Assigned: Michele Wickham » Unassigned
tripper54’s picture

Status: Reviewed & tested by the community » Fixed

OK, committed, thanks everybody!

  • tripper54 committed 6b73d53 on 7.x-3.x
    Issue #1528052 by paulihuhtiniemi, tripper54: AJAX error after voting or...

Status: Fixed » Closed (fixed)

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