Closed (fixed)
Project:
Voting API
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Apr 2018 at 09:01 UTC
Updated:
4 Apr 2020 at 21:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
useernamee commentedI am working on this.
Comment #3
useernamee commentedI've made a submodule that adds token support that you need.
Comment #4
nkoporecTested your patch although it applies and works, there are some minor issues.When applying the patch I get whitespace warnings:
Also, I think the module should be in modules subdirectory.
Comment #5
useernamee commented@nkoporec thanks for your review. I have incorporated your suggestions in this patch.
Comment #6
atobis commentedIs this submodule compatible with Drupal 7? I have the same problem but with 7.
Comment #7
proweb.ua commented#5 patch. Tokens do not work
Drupal 8.8.0-rc1
votingapi 8.x-3.x-dev
fivestar 8.x-1.x-dev
schema_metatag 8.x-1.4
metatag 8.x-1.10
PHP 7.3.3
ENTITY_TYPE - node
VOTE_TYPE - vote
my tokens
[votingapi_node_token:vote_count:vote]
[votingapi_node_token:vote_average:vote]
[votingapi_node_token:best_vote:vote]
[votingapi_node_token:worst_vote:vote]
Comment #8
proweb.ua commentedget_entity_types() do not work
works
Comment #9
shubham.prakash commentedUpdated the patch for the above fix.
Comment #10
proweb.ua commentedIf the rating has not yet changed
$replacements[$original] = $votes[$vote_type]['vote_count'];$replacements[$original] = round($votes[$vote_type]['vote_average'] / 20, 1);need to add variable check
and also
Comment #11
useernamee commentedget_entity_types() function was supposed to get possible entity types that have vote fields to be voted on.
getDefinitions() gets you all possible entity types so it is not suitable here.
I've now written a SQL query that goes through votes and gets unique entity types from there.
Comment #12
useernamee commentedComment #13
alex_optimGood work.
Comment #14
pifagorComment #16
pifagor