Skip to content
Snippets Groups Projects
Commit 005f34a5 authored by Liam Morland's avatar Liam Morland Committed by Liam Morland
Browse files

Issue #3124168: Allow longer values for pdf_key

parent 46ab67eb
No related branches found
No related tags found
No related merge requests found
...@@ -278,3 +278,30 @@ function fillpdf_update_8111() { ...@@ -278,3 +278,30 @@ function fillpdf_update_8111() {
$edum->installFieldStorageDefinition('owner_password', 'fillpdf_form', 'fillpdf_form', $owner_password); $edum->installFieldStorageDefinition('owner_password', 'fillpdf_form', 'fillpdf_form', $owner_password);
$edum->installFieldStorageDefinition('user_password', 'fillpdf_form', 'fillpdf_form', $user_password); $edum->installFieldStorageDefinition('user_password', 'fillpdf_form', 'fillpdf_form', $user_password);
} }
/**
* Increase maximum length for pdf_key.
*/
function fillpdf_update_9501() {
$db = \Drupal::database();
$transaction = $db->startTransaction();
// Update field storage definition.
$edum = \Drupal::entityDefinitionUpdateManager();
$field_storage_definition = $edum->getFieldStorageDefinition('pdf_key', 'fillpdf_form_field');
$field_storage_definition->setSetting('type', 'string_long');
$edum->updateFieldStorageDefinition($field_storage_definition);
// Update database schema.
$spec = [
'type' => 'text',
'size' => 'big',
];
$db
->schema()
->changeField('fillpdf_fields', 'pdf_key', 'pdf_key', $spec);
// Commit transaction.
unset($transaction);
}
...@@ -56,7 +56,7 @@ class FillPdfFormField extends ContentEntityBase implements FillPdfFormFieldInte ...@@ -56,7 +56,7 @@ class FillPdfFormField extends ContentEntityBase implements FillPdfFormFieldInte
->setDescription(t('The UUID of the FillPdfFormField entity.')) ->setDescription(t('The UUID of the FillPdfFormField entity.'))
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['pdf_key'] = BaseFieldDefinition::create('string') $fields['pdf_key'] = BaseFieldDefinition::create('string_long')
->setLabel(t('PDF Key')) ->setLabel(t('PDF Key'))
->setDescription(t('The name of the field in the PDF form.')); ->setDescription(t('The name of the field in the PDF form.'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment