Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the phpdoc comment for the votingapi_select_results function it is stated that every entry greater than the timestamp criteria will be selected.
* $criteria['timestamp'] (If this is set, records with timestamps
* GREATER THAN the set value will be selected.)
This is wrong. Only records with timestamps matching the set timestamp will be selected.
Comment | File | Size | Author |
---|---|---|---|
#4 | votingapi-wrong_doc_votingapi_select_results-2092931-4.patch | 642 bytes | andrei.dincu |
#2 | votingapi-wrong_doc_votingapi_select_results-2092931-2.patch | 642 bytes | andrei.dincu |
Comments
Comment #1
andrei.dincu CreditAttribution: andrei.dincu commentedComment #2
andrei.dincu CreditAttribution: andrei.dincu commentedChanged doc from GREATER THAN with MATCH.
Comment #3
andrei.dincu CreditAttribution: andrei.dincu commentedComment #4
andrei.dincu CreditAttribution: andrei.dincu commentedComment #5
torotil CreditAttribution: torotil commentedAnother thought: Are we sure that the comment is wrong and not the code? If the comment just described what should happen, and the code failed to do it then the proposed patch would just document the bug instead of solving it.
Comment #6
TR CreditAttribution: TR commentedYes, it is definitely the code that is wrong - the documentation describes what the code is supposed to do. It would not make any sense for the code to select votes that MATCH a timestamp - that's a useless selection.
There's an old issue that's already open to address this problem in the code #1304364: timestamp criteria for votingapi_select_votes and votingapi_select_results. You should contribute to that issue!