How do we fetch shs referenced terms programmatically

Created on 5 December 2022, over 2 years ago
Updated 21 November 2023, over 1 year ago

Problem/Motivation

When I upgraded this module's latest version, the code working with an older version stopped working. Earlier the below code used to fetch the terms in hook_form_alter but now it's not working: $form['field_method_of_delivery']['widget']['#options'].
When I debug the latest version of the OptionsShsWidget class formElement() function has the below code:

$element['#type'] = 'textfield';
    unset($element['#options']);

When I comment out these lines then it works as expected. is there any specific reason behind this code? Why are we suppressing the options and converting it to textfield?
Please suggest any alternative to get the values/labels of shs referenced terms programmatically.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇮🇳India suraj_vantagode

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