diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php index 14f1c6c..7a8f7e0 100644 --- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php @@ -268,15 +268,15 @@ public function testContactConfigEntityTranslation() { // Update translatable fields. $edit = array( - 'config_names[contact.contact_form.feedback][label][translation]' => 'Website feedback - ' . $langcode, - 'config_names[contact.contact_form.feedback][reply][translation]' => 'Thank you for your mail - ' . $langcode, + 'config_names[contact.form.feedback][label][translation]' => 'Website feedback - ' . $langcode, + 'config_names[contact.form.feedback][reply][translation]' => 'Thank you for your mail - ' . $langcode, ); // Save language specific version of form. $this->drupalPostForm($translation_page_url, $edit, t('Save translation')); // Expect translated values in language specific file. - $override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.contact_form.feedback'); + $override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.form.feedback'); $expected = array( 'label' => 'Website feedback - ' . $langcode, 'reply' => 'Thank you for your mail - ' . $langcode, @@ -307,7 +307,7 @@ public function testContactConfigEntityTranslation() { $langcode_prefixes = array_merge(array(''), $this->langcodes); foreach ($langcode_prefixes as $langcode_prefix) { $this->drupalGet(ltrim("$langcode_prefix/$translation_base_url/$langcode/edit")); - $this->assertFieldByName('config_names[contact.contact_form.feedback][label][translation]', 'Website feedback - ' . $langcode); + $this->assertFieldByName('config_names[contact.form.feedback][label][translation]', 'Website feedback - ' . $langcode); $this->assertText($label); } } @@ -339,7 +339,7 @@ public function testContactConfigEntityTranslation() { $this->assertNoLinkByHref("$translation_base_url/$langcode/delete"); // Expect no language specific file present anymore. - $override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.contact_form.feedback'); + $override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.form.feedback'); $this->assertTrue($override->isNew()); } diff --git a/core/modules/contact/config/install/contact.contact_form.feedback.yml b/core/modules/contact/config/install/contact.form.feedback.yml similarity index 100% rename from core/modules/contact/config/install/contact.contact_form.feedback.yml rename to core/modules/contact/config/install/contact.form.feedback.yml diff --git a/core/modules/contact/config/install/contact.contact_form.personal.yml b/core/modules/contact/config/install/contact.form.personal.yml similarity index 100% rename from core/modules/contact/config/install/contact.contact_form.personal.yml rename to core/modules/contact/config/install/contact.form.personal.yml diff --git a/core/modules/contact/config/schema/contact.schema.yml b/core/modules/contact/config/schema/contact.schema.yml index c2c83d5..7ebb6f4 100644 --- a/core/modules/contact/config/schema/contact.schema.yml +++ b/core/modules/contact/config/schema/contact.schema.yml @@ -1,6 +1,6 @@ # Schema for the configuration files of the Contact module. -contact.contact_form.*: +contact.form.*: type: config_entity label: 'Contact form' mapping: diff --git a/core/modules/contact/src/ContactFormEditForm.php b/core/modules/contact/src/ContactFormEditForm.php index c5ba2d5..072626c 100644 --- a/core/modules/contact/src/ContactFormEditForm.php +++ b/core/modules/contact/src/ContactFormEditForm.php @@ -100,11 +100,11 @@ public function save(array $form, FormStateInterface $form_state) { if ($status == SAVED_UPDATED) { drupal_set_message($this->t('Form %label has been updated.', array('%label' => $contact_form->label()))); - $this->logger('contact')->notice('Category %label has been updated.', array('%label' => $contact_form->label(), 'link' => $edit_link)); + $this->logger('contact')->notice('Form %label has been updated.', array('%label' => $contact_form->label(), 'link' => $edit_link)); } else { drupal_set_message($this->t('Form %label has been added.', array('%label' => $contact_form->label()))); - $this->logger('contact')->notice('Category %label has been added.', array('%label' => $contact_form->label(), 'link' => $edit_link)); + $this->logger('contact')->notice('Form %label has been added.', array('%label' => $contact_form->label(), 'link' => $edit_link)); } // Update the default form. diff --git a/core/modules/contact/src/Entity/ContactForm.php b/core/modules/contact/src/Entity/ContactForm.php index 5f99e49..c3d5935 100644 --- a/core/modules/contact/src/Entity/ContactForm.php +++ b/core/modules/contact/src/Entity/ContactForm.php @@ -27,7 +27,7 @@ * "delete" = "Drupal\contact\Form\ContactFormDeleteForm" * } * }, - * config_prefix = "contact_form", + * config_prefix = "form", * admin_permission = "administer contact forms", * bundle_of = "contact_message", * entity_keys = { diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index 5350893..ea24af9 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -117,7 +117,7 @@ function testSiteWideContact() { $this->assertRaw(t('Form %label has been added.', array('%label' => $label))); // Check that the form was created in site default language. - $langcode = \Drupal::config('contact.contact_form.' . $id)->get('langcode'); + $langcode = \Drupal::config('contact.form.' . $id)->get('langcode'); $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; $this->assertEqual($langcode, $default_langcode); @@ -126,7 +126,7 @@ function testSiteWideContact() { // Test update contact form. $this->updateContactForm($id, $label = $this->randomMachineName(16), $recipients_str = implode(',', array($recipients[0], $recipients[1])), $reply = $this->randomMachineName(30), FALSE); - $config = \Drupal::config('contact.contact_form.' . $id)->get(); + $config = \Drupal::config('contact.form.' . $id)->get(); $this->assertEqual($config['label'], $label); $this->assertEqual($config['recipients'], array($recipients[0], $recipients[1])); $this->assertEqual($config['reply'], $reply); diff --git a/core/modules/contact/tests/drupal-7.contact.database.php b/core/modules/contact/tests/drupal-7.contact.database.php index 7d67461..ed8e5ba 100644 --- a/core/modules/contact/tests/drupal-7.contact.database.php +++ b/core/modules/contact/tests/drupal-7.contact.database.php @@ -9,22 +9,22 @@ * the database structure expected in tests altogether. */ -// Update the default form to that it is not selected. +// Update the default category to that it is not selected. db_update('contact') ->fields(array('selected' => '0')) ->condition('cid', '1') ->execute(); -// Add a custom contact form. +// Add a custom contact category. db_insert('contact')->fields(array( - 'contact_form', + 'category', 'recipients', 'reply', 'weight', 'selected' )) ->values(array( - 'contact_form' => 'Upgrade test', + 'category' => 'Upgrade test', 'recipients'=> 'test1@example.com,test2@example.com', 'reply' => 'Test reply', 'weight' => 1,