Add support to contextual users in the FlagViewsRelationship plugin

Created on 31 March 2025, 4 months ago

Problem/Motivation

Improve the options of the Flag relationship plugin.
We may need to establish a relationship with the user in the URL instead of the current user.

Steps to reproduce

In your view, click in Add relationship.
Add a relationship with Flags, there are two options: Any user and Current user

Proposed resolution

Add another option to get the contextual user from the URL

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

4.0

Component

Views integration

Created by

🇧🇷Brazil joaopauloc.dev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @joaopauloc.dev
  • Pipeline finished with Success
    4 months ago
    Total: 159s
    #461995
  • Pipeline finished with Success
    4 months ago
    Total: 162s
    #461998
  • Pipeline finished with Success
    4 months ago
    Total: 161s
    #462000
  • Pipeline finished with Success
    4 months ago
    Total: 295s
    #462009
  • ivnish Kazakhstan

    Needs to fix phpcs and phpstan warnings

  • Pipeline finished with Success
    4 months ago
    Total: 199s
    #462497
  • 🇧🇷Brazil joaopauloc.dev

    Thanks for the quick review @ivnish.
    PHPCS issues fixed.
    Thanks.

  • ivnish Kazakhstan

    Let's create a test with demonstration that it works as expected

  • 🇧🇷Brazil joaopauloc.dev

    Hey @ivnish, I can create a test for this one.

    I’ve never written a test specifically for a view relationship. Do you happen to have an example you could share?
    I looked at some examples in Drupal core, but they weren’t very helpful.

    I did write a test for a view once — I exported the view and installed it in the test environment. Then I created the required entities, loaded the view programmatically, and executed it. But I’m not sure if that’s the best approach for this specific case. What do you think?

  • Pipeline finished with Failed
    2 months ago
    Total: 310s
    #501247
  • Pipeline finished with Failed
    2 months ago
    Total: 175s
    #501252
  • Pipeline finished with Success
    2 months ago
    Total: 196s
    #501257
Production build 0.71.5 2024