- Issue created by @ivnish
- ivnish Kazakhstan
The problem is here: https://git.drupalcode.org/project/rate/-/blob/3.0.x/src/Plugin/RateWidg...
- ivnish Kazakhstan
This is workaround without module patch
/** * Implements hook_preprocess_HOOK(). */ function MYMODULE_preprocess_rate_widgets_summary(&$variables) { if (isset($variables['vote'])) { /** @var \Drupal\votingapi\Entity\Vote $vote */ $vote = $variables['vote']; if ($vote->getVotedEntityType() === 'comment') { $voting_service = \Drupal::service('plugin.manager.votingapi.resultfunction'); if ($voting_service) { $results = $voting_service->getResults('comment', $vote->getVotedEntityId()); if ($results) { $variables['rate_count'] = $results['updown']['vote_count']; $variables['rate_sum'] = $results['updown']['vote_sum']; } } } } }
And then use new variables in your summary template