Duplicate votes with different ID in a same node and user

Created on 17 February 2025, about 2 months ago

Hello, I have a problem with voting api, views and a migration. I have version 8.3 dev installed with the patch to be able to create relationships in the views. When I try to create a view related to a user, all of their votes (to nodes) appear duplicated. The strange thing is that the votes from the same node have different IDs (for example, the vote for node 2200 has 2 votes for the same user but with a different ID, for example 3100 and 3210). Can someone help me solve it? I have seen that in one of the issues a similar problem is discussed that appears when the translation is activated 🐛 Views shows multiples results for the same vote when is enabled content translation Needs review (), as is my case, but I have also applied the patch offered there and it still fails. Any help please?

💬 Support request
Status

Active

Version

3.0

Component

Views Integration

Created by

🇪🇸Spain dcine

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

Comments & Activities

  • Issue created by @dcine
  • 🇪🇸Spain dcine

    Updated:
    From what it seems, the error appears when adding a sort order by vote date. Any help, please? If this order criterion is not added, the votes are not duplicated. It's quite strange...

  • 🇪🇸Spain dcine

    Resolved. I leave the small solution here in case it could be useful to any other user: Apparently, the problem was in the migration and the different versions of "Voting API". While I was migrating from Drupal 7 to Drupal 10, I added several patches to the module and this caused some type of error that forced me to delete the migration of the votes and migrate them again. The deletion seems to have not worked and, in some way that I don't know, the same votes were duplicated with different IDs. When creating the view and adding a sort order, the error was evident. To solve this I have deleted the votes through phpmyadmin and I have migrated the vote table again (migrate:import d7_vote:node:…) and now everything is back to normal.

Production build 0.71.5 2024