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.

Comments

trrroy created an issue. See original summary.

trrroy’s picture

Issue summary: View changes
vinodhini.e’s picture

StatusFileSize
new113.3 KB

Hello @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.

vinayakmk47’s picture

Status: Active » Needs review

Hello @trrroy, I have also tested the issue tried to reproduce not able to replicate the issue.

jbuttler’s picture

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