Problem/Motivation
Cannot delete entities with no voting. I get this error
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'tester_token': DELETE FROM "votingapi_result" WHERE ("entity_type" = :db_condition_placeholder_0) AND ("entity_id" = :db_condition_placeholder_1); Array ( [:db_condition_placeholder_0] => token_custom [:db_condition_placeholder_1] => tester ) in Drupal\votingapi\VoteStorage->deleteVotesForDeletedEntity() (line 89 of web/modules/contrib/votingapi/src/VoteStorage.php).
Steps to reproduce
Install token_custom module. Create new custom token. Try to delete the new token.
Proposed resolution
In function deleteVotesForDeletedEntity() check for the empty($votes) and return. Patch is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screenshot (61).png | 113.3 KB | vinodhini.e |
| voting_api-delete-empty_0.patch | 674 bytes | trrroy |
Comments
Comment #2
trrroy commentedComment #3
vinodhini.e commentedHello @trrroy,
Tested on Drupal 10.4.1 with Voting API and Custom Token installed to reproduce the issue. However, the token was deleted, making it impossible to replicate the problem. I checked recent log messages but found no relevant issues.
Attached the screenshot for reference.
Comment #4
vinayakmk47Hello @trrroy, I have also tested the issue tried to reproduce not able to replicate the issue.
Comment #5
jbuttler commentedI am also experiencing this issue, which is posted at https://www.drupal.org/project/token_custom/issues/3505396#comment-15988391.
The provided patch fails to apply on my system on the current version 3.0.0.-beta-5.