From 8b970c572457b2c28c2a19acade7ce8b703732c8 Mon Sep 17 00:00:00 2001
From: Bernd Oliver Suenderhauf <bos@suenderhauf.de>
Date: Tue, 7 May 2019 23:21:26 +0200
Subject: [PATCH] Issue #3053261 by Pancho: Visually improve
 FillPdfFormFieldForm

---
 src/Entity/FillPdfFormField.php   |  2 +-
 src/Form/FillPdfFormFieldForm.php | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/Entity/FillPdfFormField.php b/src/Entity/FillPdfFormField.php
index bdc9c61..10847e9 100644
--- a/src/Entity/FillPdfFormField.php
+++ b/src/Entity/FillPdfFormField.php
@@ -78,7 +78,7 @@ class FillPdfFormField extends ContentEntityBase implements FillPdfFormFieldInte
 
     $fields['value'] = BaseFieldDefinition::create('string_long')
       ->setLabel(t('Fill pattern'))
-      ->setDescription(t('Text and tokens with which to fill in the PDF.'))
+      ->setDescription(t('Text and tokens with which to fill in the PDF. This field supports tokens.'))
       ->setDisplayOptions('form', [
         'type' => 'string_long',
         'weight' => 0,
diff --git a/src/Form/FillPdfFormFieldForm.php b/src/Form/FillPdfFormFieldForm.php
index dc65f03..bd8b0bb 100644
--- a/src/Form/FillPdfFormFieldForm.php
+++ b/src/Form/FillPdfFormFieldForm.php
@@ -49,7 +49,17 @@ class FillPdfFormFieldForm extends ContentEntityForm {
   public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
-    $form['token_help'] = $this->adminFormHelper->getAdminTokenForm();
+    $form['prefix']['widget']['0']['value']['#rows'] = 3;
+
+    $form['value']['token_help'] = $this->adminFormHelper->getAdminTokenForm();
+
+    $form['suffix']['widget']['0']['value']['#rows'] = 3;
+
+    $form['extra'] = [
+      '#type' => 'details',
+      '#title' => $this->t('Transform values'),
+    ];
+    $form['replacements']['#group'] = 'extra';
 
     return $form;
   }
-- 
GitLab