View exposed filter

Created on 8 March 2024, 10 months ago
Updated 28 March 2024, 9 months ago

Problem/Motivation

Currently if we create a view and add a relationship. Then use the node id of that target relationship as an exposed filter, in the graphql we don't see the nid field so that we can pass a parameter

I believe the error is coming from the the ViewsSchemaBuilder::isGenericInputFilter. If I force it to return false, then I am able to see that nid exposed filter.

Now the error could also be coming from line 215-223 where a check is made via the isGenericInputFilter but for some reason, the codes in it are commented.

foreach ($filters as $filterName => $filter) {
        if ($this->isGenericInputFilter($filter)) {
          // @todo Implement correctly.
          //return $this->createGenericInputFilterDefinition($filter);
          continue;
        }
        $argTypeName = EntitySchemaHelper::toCamelCase($filterName);
        $args[$argTypeName] = $filter['expose']['multiple'] ? Type::listOf(Type::string()) : Type::string();
      }
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇲🇺Mauritius whiz11

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

Comments & Activities

  • Issue created by @whiz11
  • 🇲🇺Mauritius whiz11

    Adding a workaround to allow exposed filter to appear for now. But I think this needs a better fix.

  • Status changed to Closed: works as designed 9 months ago
  • 🇲🇺Mauritius whiz11

    This patch is not needed on the latest version. It has now been fixed.

  • Status changed to Needs work 9 months ago
  • 🇲🇺Mauritius whiz11

    I am reopening this since I made a mistake in my test. This is still not working and I had to resort to the patch to get the generic filter to appear

  • Status changed to Active 9 months ago
Production build 0.71.5 2024