Revert "Issue #2349651 by yannisc, larowlan: Fixed Default contact form does not send email as email recipient is not set during the installation."

This reverts commit 62f8b460fe.
8.0.x
Alex Pott 2014-10-09 08:03:49 +01:00
parent 62f8b460fe
commit ad302e36e3
2 changed files with 0 additions and 15 deletions

View File

@ -8,7 +8,6 @@
namespace Drupal\standard\Tests;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\contact\Entity\ContactForm;
use Drupal\simpletest\WebTestBase;
/**
@ -113,10 +112,6 @@ class StandardTest extends WebTestBase {
\Drupal::moduleHandler()->uninstall(array('editor', 'ckeditor'));
$this->rebuildContainer();
\Drupal::moduleHandler()->install(array('editor'));
/** @var \Drupal\contact\ContactFormInterface $contact_form */
$contact_form = ContactForm::load('feedback');
$recipients = $contact_form->getRecipients();
$this->assertEqual(['simpletest@example.com'], $recipients);
}
}

View File

@ -4,7 +4,6 @@
* Enables modules and site configuration for a standard site installation.
*/
use Drupal\contact\Entity\ContactForm;
use Drupal\Core\Form\FormStateInterface;
/**
@ -15,13 +14,4 @@ use Drupal\Core\Form\FormStateInterface;
function standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
// Pre-populate the site name with the server name.
$form['site_information']['site_name']['#default_value'] = \Drupal::request()->server->get('SERVER_NAME');
$form['#submit'][] = 'standard_form_install_configure_submit';
}
/**
* Submission handler to sync the contact.form.feedback recipient.
*/
function standard_form_install_configure_submit($form, FormStateInterface $form_state) {
$site_mail = $form_state->getValue('site_mail');
ContactForm::load('feedback')->setRecipients([$site_mail])->save();
}