diff --git a/fillpdf.install b/fillpdf.install index 5a1cc232d9e8bae7b8bfce366718a881080032c2..bdc1f4fbce8da93eba0180c588741861bed61728 100644 --- a/fillpdf.install +++ b/fillpdf.install @@ -70,6 +70,7 @@ function fillpdf_schema() { 'pdf_key' => array( 'type' => 'varchar', 'length' => 255, + 'binary' => TRUE, 'not null' => TRUE, ), 'label' => array( @@ -398,3 +399,15 @@ function fillpdf_update_7107() { 'length' => 255, )); } + +/** + * Mark {fillpdf_fields}.pdf_key BINARY to make it behave case-sensitive. + */ +function fillpdf_update_7108() { + db_change_field('fillpdf_fields', 'pdf_key', 'pdf_key', array( + 'type' => 'varchar', + 'length' => 255, + 'binary' => TRUE, + 'not null' => TRUE, + )); +} diff --git a/fillpdf.module b/fillpdf.module index 6a8aad0195c11db8b1b69059434080878fafb6be..78c0cb3eddeaac9c5bdeda4fde5093b2933bfb58 100644 --- a/fillpdf.module +++ b/fillpdf.module @@ -1783,8 +1783,14 @@ function fillpdf_execute_parse($method, $fillpdf, $mode = 'url') { 'value' => '', 'type' => 'Text', ), - // Test duplicate name. + // Test field name only different in case. 3 => array( + 'name' => 'textfield', + 'value' => '', + 'type' => 'Text', + ), + // Test duplicate field name that should be consolidated. + 4 => array( 'name' => 'ImageField', 'value' => '', 'type' => 'Pushbutton', diff --git a/tests/FillPdfTestHelper.test b/tests/FillPdfTestHelper.test index c8681cf730a7a7797a2c0a76bf616fd07038ddbe..12c2d3799e6fd2bea7dd861c5d9288064724d98b 100644 --- a/tests/FillPdfTestHelper.test +++ b/tests/FillPdfTestHelper.test @@ -41,7 +41,7 @@ trait FillPdfTestHelper { 'files[upload_pdf]' => drupal_realpath(drupal_get_path('module', 'fillpdf') . '/tests/fillpdf_test_v4.pdf'), ), t('Upload')); $this->assertText('fillpdf_test_v4.pdf was successfully uploaded.'); - $this->assertResponse(200, "The duplicate field is consolidated and doesn't lead to an integrity constraint violation."); + $this->assertResponse(200, 'No integrity constraint violation.'); } /**