- Issue created by @mscipioni
- πΊπΈUnited States tr Cascadia
I don't think there is an exact replacement. I wasn't involved in the D7 version of this module or in the port, but it looks like in D7 the votes were stored in a custom table and now in D8+ votes are stored as entities.
votingapi_set_votes()
in D7 looks like it does bulk operations to insert/update/delete multiple votes from the database in one operation. But there is no corresponding way to insert/update/delete entities in bulk in D8+.I don't know if this change is documented anywhere - it looks like the D7 code was just replaced by a privately developed D8 version without discussion, so it's not clear to me what architectural changes were made and why, and it's not clear to me what functionality was lost (intentionally or otherwise), replaced, or added.
It *is* clear to me that in the port we lost a lot of documentation on how to use this module. If someone has current documentation or is willing to write improved documentation we would all appreciate the help.
As far as porting your code goes, I would look at
_votingapi_cast_votes()
found invotingapi.devel.inc
in the D7 version andcastVotes()
found insrc/Commands/VotingApiCommand.php
in the D8+ version. Those functions do the exact same thing, so I think this makes it clear how to achieve the "set votes" functionality in D8+.