Closed (works as designed)
Project:
Voting API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
14 Nov 2014 at 03:51 UTC
Updated:
4 May 2021 at 01:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fmitchell commentedComment #2
fmitchell commentedAttaching patch.
Comment #3
tr commentedPatch still applies. Reviews please ...
Comment #4
tr commentedOK, I finally got around to looking at this ...
votingapi_votingapi_storage_select_votes()is an implementation ofhook_votingapi_storage_select_votes(). This hook is ONLY called byvotingapi_select_votes()- no other code should be invoking hook functions directly.I have checked, and
votingapi_select_votes()will ALWAYS pass an array as the first parameter tohook_votingapi_storage_select_votes(). It will NEVER pass a null or a non-array value. The hook itself is documented to take an array as the first argument, but because of Drupal's architecture there is no way to enforce that, except for the fact that the only place the hook should be called is from within the module that defines the hook. Voting API calls its own hooks correctly.In short, there is no way that this error should ever happen unless you are calling
votingapi_votingapi_storage_select_votes()directly from your code. And if you are doing that, you should NOT be doing that. And if you really want to do that anyway, it's the responsibility of YOUR code to ensure that it is called correctly.