Taxonomy для Iframe

Created on 18 July 2021, over 3 years ago
Updated 12 November 2023, about 1 year ago

Problem/Motivation

Сделайте возможность выбирать Taxonomy_name для каждого Iframe :)
на место Title

Steps to reproduce

Proposed resolution

файл -> IframeWidgetBase.php

// \iframe_debug(0, 'add-story formElement final setting', $settings);
foreach ($settings as $attribute => $attrValue) {
$item->setValue($attribute, $attrValue);
}

$element += [
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#open' => TRUE,
];
if (!$on_admin_page) {
$element['#title'] = $field_definition->getLabel();
}

/* хочу изменить эту часть кода */

$element['title'] = [
'#type' => 'textfield',
'#title' => $this->t('Iframe Title'),
'#placeholder' => '',
'#default_value' => $settings['title'],
'#size' => 80,
'#maxlength' => 1024,
'#weight' => 2,
// '#element_validate' => array('text'),
];
/* на это */

$element['title'] = [
'#type' => 'entity_autocomplete',
'#target_type' => 'taxonomy_term',
'#autocreate' => array( 'bundle' => 'tags', ),
'#default_value' => $?['title'],

];

}

Моя проблема в том, как сохранить значения заголовка.

Вот сама ошибка -> InvalidArgumentException: The #default_value property has to be an entity object or an array of entity objects. in Drupal\Core\Entity\Element\EntityAutocomplete::valueCallback() (line 114 of C:\xampp2\htdocs\1\1\core\lib\Drupal\Core\Entity\Element\EntityAutocomplete.php).

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: outdated

Version

2.0

Component

Miscellaneous

Created by

🇷🇺Russia acakyra

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