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

Voter relationship

Proposed resolution

Add a custom relationship to filter by the current user.

Issue fork votingapi-3383837

Command icon 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

eduardo morales alberti’s picture

Status: Needs work » Needs review

eduardo morales alberti’s picture

StatusFileSize
new3.01 KB

Added patch, please review.

tr’s picture

Version: 8.x-3.x-dev » 4.0.x-dev
eduardo morales alberti’s picture

Added schema user_scope to MR