From 8f26d7a05bad63c064e85f028719ca984466ea4a Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 23 Aug 2022 10:38:12 +0200 Subject: [PATCH] SUPP0RT-596: Limited document title length --- .../WebformHandler/DigitalPostWebformHandler.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php index 122eb3e..cfac444 100644 --- a/src/Plugin/WebformHandler/DigitalPostWebformHandler.php +++ b/src/Plugin/WebformHandler/DigitalPostWebformHandler.php @@ -25,6 +25,14 @@ * ) */ class DigitalPostWebformHandler extends WebformHandlerBase { + /** + * Maximum length of title on digital post document. + * + * It's not obvious, i.e. clearly documented, what the maximum length actually + * is, but it's less than 34. + */ + private const DOCUMENT_TITLE_MAX_LENGTH = 32; + /** * The token manager. * @@ -158,6 +166,8 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#title' => $this->t('Title of document'), '#required' => TRUE, '#default_value' => $this->configuration['document_title'], + '#maxlength' => self::DOCUMENT_TITLE_MAX_LENGTH, + '#description' => $this->t('Note that the document title can contain at most @max_length characters.', ['@max_length' => self::DOCUMENT_TITLE_MAX_LENGTH]), ]; // Development.