Problem/Motivation
As the module flags it is helpful have the option of filtering the voting views by the current user. https://git.drupalcode.org/project/flag/-/blob/8.x-4.x/src/Plugin/views/...
if ($this->options['user_scope'] == 'current' && !$flag->isGlobal()) {
$this->definition['extra'][] = [
'field' => 'uid',
'value' => '***CURRENT_USER***',
'numeric' => TRUE,
];
The views on the module are not filtered by the current user, but in some cases, like pages to see "my votes", this option is helpful.
Steps to reproduce
- Create a view page using the votes or alter the existing ones
- Add or edit the voter relationship and choose "current user"
- Visit the view as authenticated and check that the view is filtered by the current user

Proposed resolution
Add a custom relationship to filter by the current user.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | votingapi-3383837-3.patch | 3.01 KB | eduardo morales alberti |
| voter_relationship.png | 50.35 KB | eduardo morales alberti |
Issue fork votingapi-3383837
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
eduardo morales albertiComment #4
eduardo morales albertiAdded patch, please review.
Comment #5
tr commentedComment #6
eduardo morales albertiAdded schema user_scope to MR