Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Plugin/WebformHandler/DigitalPostWebformHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
Expand Down