summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2017-01-14 11:48:46 (GMT)
committerAlex Pott2017-01-14 11:48:46 (GMT)
commit57fdb946ef2644b2438a9bdd01c0162b106f78be (patch)
treee186739364226fdc052851dc34f3acb0fab91eab
parent8f2befb326ddd1c7a85b1973eccd695b6ac5a799 (diff)
Issue #1867030 by larowlan, Berdir, Oleksiy, andypost, fil00dl: Contact message preview appears at random form position after sorting fields in Manage fields
-rw-r--r--core/modules/contact/contact.module5
-rw-r--r--core/modules/contact/src/Tests/ContactSitewideTest.php5
2 files changed, 10 insertions, 0 deletions
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index a35cd25..4306e3b 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 c00ad3d..ffc2e90 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -50,6 +50,7 @@ class ContactSitewideTest extends WebTestBase {
'administer users',
'administer account settings',
'administer contact_message fields',
+ 'administer contact_message form display',
]);
$this->drupalLogin($admin_user);
@@ -283,6 +284,10 @@ class ContactSitewideTest extends WebTestBase {
$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);