Commit 12dbc74d authored by catch's avatar catch

Issue #2823600 by cebasqueira, jungle, amit.drupal, shashikant_chauhan:...

Issue #2823600 by cebasqueira, jungle, amit.drupal, shashikant_chauhan: Incorrect case in pre_render callback in TextTrimmedFormatter::viewElements()
parent 09ad5fdb
...@@ -74,7 +74,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) { ...@@ -74,7 +74,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
// because text_pre_render_summary() must run last. // because text_pre_render_summary() must run last.
$element += \Drupal::service('element_info')->getInfo($element['#type']); $element += \Drupal::service('element_info')->getInfo($element['#type']);
// Add the #pre_render callback that renders the text into a summary. // Add the #pre_render callback that renders the text into a summary.
$element['#pre_render'][] = '\Drupal\text\Plugin\field\FieldFormatter\TextTrimmedFormatter::preRenderSummary'; $element['#pre_render'][] = [TextTrimmedFormatter::class, 'preRenderSummary'];
// Pass on the trim length to the #pre_render callback via a property. // Pass on the trim length to the #pre_render callback via a property.
$element['#text_summary_trim_length'] = $this->getSetting('trim_length'); $element['#text_summary_trim_length'] = $this->getSetting('trim_length');
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment