Hi. I just struggled with a bug that drove me a little crazy. My site was chugging along just fine and then I would save a node, or a configuration or something, and suddenly all my views that used votingapi would blow up.

I kept looking for things that caused it -- was it the module I just enabled? Was it this? That?

I found out the problem, and it was subtle.

When the views blew up, I looked at the views UI screen and found that all my references to votingapi fields and sorts had been messed up -- replaced with blank lines with no descriptions and no options.

I found out that, when the views module called "module_implements('views_tables')", the votingapi module had not been loaded yet.

The solution: I had to go into my database and decrease the module weight of votingapi.

UPDATE system SET weight=-1 WHERE name='votingapi' and type='module';

Apparently, the two modules had the same weight, so whether or not they loaded in a propitious order depended on the random whims of their order in the database, which would sometimes change when I poked random data in there.

I don't think this is actually a bug, so much as an inevitable consequence of drupal. But mostly, something that a potential user of votingapi should know about.

Should I have marked this as a bug in "documentation" rather than "code"? I'm not sure. There might be a programmatic way of fixing this, and that would be preferred.

Comments

Scott Reynolds’s picture

Perhaps instead, you would raise the weight of Views. Then this could be moved over to views queue as a bug, and when views installs it should set its weight to the heaviest. This would prevent this from happening with any module.

fasdalf@fasdalf.ru’s picture

I have installed image + fivestar + votingapi. Then i installed Veiws2 (dev). It has weight set to 10. Image and Fivestar have weight 0 both. their fields and filters did not appear in views UI.
I did clear cahe (both drupal and views).
What should i do?
My bad. I didn't notice "relationships" on edit page.

eaton’s picture

Status: Active » Closed (won't fix)

Support for the 5.x branch of VotingAPI has ended with the release of Drupal 7 and the upcoming release of VotingAPI 7.x-2.4.