diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index a35cd25b0393561c796cabd0cb24674eae0b1ae4..4306e3beb8748e5b676a4fd3741e927f2f912984 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -69,6 +69,11 @@ function contact_entity_extra_field_info() { 'weight' => -30, ); } + $fields['contact_message'][$bundle]['form']['preview'] = array( + 'label' => t('Preview sender message'), + 'description' => t('Preview'), + 'weight' => 40, + ); $fields['contact_message'][$bundle]['form']['copy'] = array( 'label' => t('Send copy to sender'), 'description' => t('Option'), diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index c00ad3ddb04710553f91e20f77496d119d4eea43..ffc2e9091c99227a994e6ad3b42ec06ce2e61710 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -50,6 +50,7 @@ function testSiteWideContact() { 'administer users', 'administer account settings', 'administer contact_message fields', + 'administer contact_message form display', ]); $this->drupalLogin($admin_user); @@ -283,6 +284,10 @@ function testSiteWideContact() { $this->fieldUIAddNewField(NULL, $field_name, $field_label, 'text'); $field_name = 'field_' . $field_name; + // Check preview field can be ordered. + $this->drupalGet('admin/structure/contact/manage/' . $contact_form . '/form-display'); + $this->assertText(t('Preview')); + // Check that the field is displayed. $this->drupalGet('contact/' . $contact_form); $this->assertText($field_label);