Views exposed filter using contextual filter Group ID from URL not working on node display

Created on 27 February 2023, almost 2 years ago
Updated 24 May 2023, over 1 year ago

Problem/Motivation

I wanted to create a block with a single title search, which allows users to search for nodes in the current group context.
A views exposed filter block that uses contextual filter 'Content ID From URL' when used throws a fatal error, not on group displays but on group node displays.

The website encountered an unexpected error. Please try again later.
TypeError: _social_group_get_current_group(): Return value must be of type ?Drupal\social_group\SocialGroupInterface, string returned in _social_group_get_current_group() (line 1871 of profiles/contrib/social/modules/social_features/social_group/social_group.module).
_social_group_get_current_group() (Line: 37)
Drupal\social_group\EventSubscriber\RedirectSubscriber->checkForRedirection()
call_user_func() (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 145)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

- Clean install of Open social.
- Create a new view that lists content, add a contextual filter using 'Group ID from URL' using the relationship 'Content from group content'.
- create a normal exposed filter for the title field. Exposed form in block: yes.
- Place the block in a group node display.
- When using the exposed form block, the error appears.
- When placing the block in a group display, the error does not appear.

🐛 Bug report
Status

Active

Version

11.7

Component

Code (back-end)

Created by

🇳🇱Netherlands Yuri

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

Comments & Activities

Production build 0.71.5 2024