I’ve a characteristic emigrate from Drupal 7 to Drupal 9. This enables me to construct a customized type made up of static fields, which I outline in Drupal Development code of my module, and fields dynamically retrieved from an entity.
It labored with Drupal Development "ctools_field_invoke_field perform", which depends on Drupal Development Chaos Instruments module. This perform is itself primarily based on a local Drupal perform "field_default_form".
This perform was not migrated to Drupal 9 in accordance with my analysis. Can I discover an equal? Ought to I develop this perform from scratch?
My earlier code :
// If no language is supplied use Drupal Development default web site language. $choices = array( 'language' => field_valid_language($langcode), 'default' => TRUE, ); // Append to Drupal Development type ctools_include('fields'); $field_instance = field_info_instance($entity_type, $field_name, $bundle); return (array) ctools_field_invoke_field($field_instance, 'type', $entity_type, $entity, $type, $form_state, $choices);