Error when trying to add Contextual Filter in Drupal Views

Created on 12 April 2024, 2 months ago
Updated 15 April 2024, 2 months ago

Problem/Motivation

I am working on a Drupal Commerce project.I am running Drupal Version 9.5.11 and Commerce Version: 8.x-2.38 I am trying in my Product inner page to show other Products that have the same category with the Product on which I currently am on.

This should be a simple task but I can't understand what is going on. I create my View:

*See first Picture

Now when I try to add my Contextual Filter on Product ID and I try to Provide Default Value and then choose Content ID from URL, and I click apply nothing is happening. The form is not being submitted.

I open my console log and I see this error every time I press the Apply button:

*See second Picture

When I inspect the code of the form, I can find an element Profile Type, which is required, and `display: none` is applied to it. It has a small dropdown but without any options inside:

*See third Picture

It's the first time I encounter something like this. I don't understand what is causing this problem and how to fix it. I don't even understand what the problem is. Why is there a required field with `display: none` and why is it required?

What should I do? Anyone encountered this or can help?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

💬 Support request
Status

Closed: cannot reproduce

Version

9.5

Component
Views  →

Last updated about 5 hours ago

Created by

🇨🇾Cyprus chrisk8r

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

Comments & Activities

  • Issue created by @chrisk8r
  • Status changed to Postponed: needs info 2 months ago
  • 🇺🇸United States cilefen

    Drupal 9 reached its end of life in November 2023 and is no longer supported here.

    Please set up a supported version and add complete steps to reproduce.

  • 🇮🇳India Shikha_LNweb

    @chrisk8r

    Can you try selecting the other option under Product-Id contextual filter like RAW Value From URL where you would be able to select the Path component that you may like to us from the url to work as contextual filter.

  • Status changed to Closed: cannot reproduce 2 months ago
  • 🇳🇱Netherlands Lendude Amsterdam

    As pointed out in #3, 'Content ID from URL' won't work with products, because it will look for a node ID, not a product ID (naming things is hard)

    The hidden selector 'Profile ID' is not something that comes from core, no idea what puts it in your form, but it is probably something from contrib or custom code. So best start looking there.

Production build 0.69.0 2024