Cannot delete entity with no voting

Created on 12 February 2025, 25 days ago

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 tokens_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.

🐛 Bug report
Status

Active

Component

Code

Created by

🇺🇸United States trrroy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024