city default_value is not translated

Created on 24 January 2024, 11 months ago
Updated 1 February 2024, 11 months ago

Problem/Motivation

commerce_novaposhta/src/Element/Novaposhta.php

city default_value

t('- None -')

line 119:

$city_options = ['' => t('- None -')] + $novaposhtaManager->extractCityOptions($cities);

if you do not select any value immediately when opening the page
line 155:

    $element['city'] = [
      '#type' => 'select',
      '#title' => t('City'),
      '#options' => $city_options,
      '#default_value' => $values['city'] ?? NULL,
      '#required' => $element['#required'],
      '#maxlength' => 36,
      '#parents' => array_merge($element['#parents'], ['city']),
      '#ajax' => [
        'callback' => [get_called_class(), 'ajaxRefresh'],
        'disable-refocus' => TRUE,
        'event' => 'change',
        'wrapper' => $wrapper_id,
      ],
'#default_value' => $values['city'] ?? NULL,

default_value = NULL

There is also no way to set this default value through the admin panel.

πŸ› Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine proweb.ua

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

Comments & Activities

Production build 0.71.5 2024