support other translatable entities

Created on 12 October 2020, over 4 years ago
Updated 6 July 2023, over 1 year ago

Problem/Motivation

I needed to apply this filter to a list of translated taxonomy terms. Currently the filter is hard-coded to apply to nodes.

Steps to reproduce

Create a View for any translatable entity other than Node, and the select_translation filter is unavailable.

Proposed resolution

Generalize the filter applicability to other entities by removing hard-coded references to Nodes.

Remaining tasks

While I think I've generalized the filter itself to work with any (most?) translatable entities, I only added taxonomy_term to the hook_views_data_alter() registry. Presumably this hook could spin through all entities and register the filter for any that meet requirements (i.e., are translatable).

I'll admit to not fully understanding the Views API so there could be limitations I'm not seeing.

User interface changes

Generalize some wording on the filter description.

API changes

Using FilterPluginBase API for tables and field names.

Data model changes

n/a?

✨ Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024