Allow access to the workflow state object in hook_preprocess_views_view_field

Created on 1 February 2022, over 3 years ago
Updated 10 April 2025, 3 months ago

Motivation

I wanted to add an additional markup to the output of the current_state field, and I noticed that only the state's label is available in hook_preprocess_views_view_field hook context.

Steps to reproduce

Create a view with current_state_views_field in there, then implement hook_preprocess_views_view_field hook, check that there's no additional data in $variables['field']

Proposed resolution

Store the current state object in an attribute of current_state_views_field object

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇷Argentina matiasmiranda Yerba Buena

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.

Production build 0.71.5 2024