Views contextual filter replacement pattern doesn't use referenced entity's title available

Created on 10 January 2020, over 4 years ago
Updated 23 October 2023, 9 months ago

I'm not sure what the root cause of this bug is, but I figured I'd start here.

I have a View set up with the path

node/%/events

that lists all content of type Event which is attached to an organic group. This works great, and using Subpathauto I can access the pages via the OG node's alias, e.g.

/mygroup/events

. Beautiful.

The problem is that I want the title of the base node to be shown in the page title and it's only showing the node's ID. Normally I would be able to do this using the "Override title" option on the contextual filter and fill in something like Upcoming Events for {{ arguments.og_audience_target_id }}, because the replacement patterns specifically says:

The following replacement tokens are available for this argument.

{{ arguments.og_audience_target_id }} == Content: Organization (og_audience) title
{{ raw_arguments.og_audience_target_id }} == Content: Organization (og_audience) input

In theory the {{ arguments.og_audience_target_id }} string should output the node's title, but instead it's outputting the raw input.

There's an existing core issue focused on this problem ( πŸ› views - contextual filter - how to get term name, not term id Closed: duplicate ) but there isn't a workable solution that directly affects the contextual filters.

I'm starting here on the off chance that Sub-pathauto is changing Views' behavior, if the problem ends up being elsewhere I'll move the issue.

πŸ› Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada NickDickinsonWilde Victoria, BC (T'So-uke lands)

    This module doesn't *directly* impact the view. But it doesn't surprise me that it messes that up. I think it should be possible to fix generically, but might be hard. Putting as postponed since definitely not on my to do list right now but seems like a valid bug as well.
    Thanks for the workaround too

  • πŸ‡¦πŸ‡ΊAustralia Katy Swain

    This appears to be a D8+ Views regression. πŸ› Fix label token replacement for views entity reference arguments RTBC I've been wrestling with it for ages, and have only installed subpathauto five minutes ago, so it's definitely not this module's fault.

    I'm just getting back into Drupal after nearly a decade, and this used to be a standard content modelling trope with me; an entity overview page with a whole bunch of child pages following relationships to other entities. I can't imagine how hordes of people aren't screaming over this when something as elementary as 'taxonomy/term/1/articles' can only be re-titled 'Articles About 1' rather than 'Articles About My Cat Desmond'.

Production build 0.69.0 2024