Skip to content
Snippets Groups Projects
Commit 0fd48604 authored by Nicolás Moncada's avatar Nicolás Moncada Committed by Merlin Axel Rutz
Browse files

Issue #3202059 by mnico, geek-merlin: Token in field description is not...

Issue #3202059 by mnico, geek-merlin: Token in field description is not replaced when using the Complex widget
parent 3d19dd98
Branches
Tags
2 merge requests!113Draft: Automated Project Update Bot fixes,!9Issue #3202059: Token in field description is not replaced when using the Complex widget
......@@ -226,7 +226,7 @@ class InlineEntityFormComplex extends InlineEntityFormBase implements ContainerF
$element = [
'#type' => $this->getSetting('collapsible') ? 'details' : 'fieldset',
'#tree' => TRUE,
'#description' => $this->fieldDefinition->getDescription(),
'#description' => $this->getFilteredDescription(),
'#prefix' => '<div id="' . $wrapper . '">',
'#suffix' => '</div>',
'#ief_id' => $this->getIefId(),
......
......@@ -15,7 +15,7 @@ field_name: multi
entity_type: node
bundle: ief_test_complex
label: Multiple nodes
description: 'Reference multiple nodes.'
description: 'Reference multiple nodes. A complex widget on [site:name].'
required: true
translatable: false
default_value: { }
......
......@@ -1019,6 +1019,17 @@ class ComplexWidgetTest extends InlineEntityFormTestBase {
$assert_session->pageTextContains("IEF test nested 1 $title_1 has been created.");
}
/**
* Tests the token replacement in the description field.
*/
public function testTokenReplacementInDescriptionField() {
$assert_session = $this->assertSession();
$this->drupalGet($this->formContentAddUrl);
$site_name = \Drupal::token()->replace('[site:name]');
$assert_session->pageTextContains('Reference multiple nodes. A complex widget on ' . $site_name . '.');
}
/**
* Data provider: FALSE, TRUE.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment