Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -1,12 +0,0 @@
|
|||
# Schema for the migration source plugins.
|
||||
|
||||
migrate.source.contact_settings:
|
||||
type: migrate_source_sql
|
||||
label: 'Drupal contact settings'
|
||||
mapping:
|
||||
variables:
|
||||
type: sequence
|
||||
label: 'Variables'
|
||||
sequence:
|
||||
type: string
|
||||
label: 'Variable'
|
|
@ -35,14 +35,6 @@ function contact_help($route_name, RouteMatchInterface $route_match) {
|
|||
$output .= '</dl>';
|
||||
return $output;
|
||||
|
||||
case 'entity.contact_form.collection':
|
||||
$menu_page = \Drupal::moduleHandler()->moduleExists('menu_ui') ? \Drupal::url('entity.menu.collection') : '#';
|
||||
$block_page = \Drupal::moduleHandler()->moduleExists('block') ? \Drupal::url('block.admin_display') : '#';
|
||||
$output = '';
|
||||
$output .= '<p>' . t('The <em>Personal contact form</em> is the form for site visitors to contact registered users; the name and recipients of this form cannot be edited. Other forms listed here are your configured site-wide contact forms, which site visitors can use to send mail to a centralized email address or addresses. You can edit the name and recipients of site-wide forms by choosing the <em>Edit</em> operation. You can also configure the fields and display of both personal and site-wide forms.') . '</p>';
|
||||
$output .= '<p>' . t('If you have configured a default site-wide contact form, a <em>Contact</em> menu link in the <em>Footer</em> menu will link to it. You can modify this link from the <a href=":menu-settings">Menus page</a> if you have the Menu UI module installed. You can also create links to other contact forms; the URL has format contact/machine_name_of_form.', array(':menu-settings' => $menu_page)) . '</p>';
|
||||
$output .= '<p>' . t('If you would like additional text to appear on a site-wide contact page, beyond field labels, use a block. You can create and edit blocks on the <a href=":blocks">Block layout page</a>, if you have the Block module installed.', array(':blocks' => $block_page)) . '</p>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,7 +135,7 @@ function contact_mail($key, &$message, $params) {
|
|||
$message['subject'] .= t('[@form] @subject', $variables, $options);
|
||||
$message['body'][] = t("@sender-name (@sender-url) sent a message using the contact form at @form-url.", $variables, $options);
|
||||
$build = entity_view($contact_message, 'mail');
|
||||
$message['body'][] = (string) \Drupal::service('renderer')->renderPlain($build);
|
||||
$message['body'][] = \Drupal::service('renderer')->renderPlain($build);
|
||||
break;
|
||||
|
||||
case 'page_autoreply':
|
||||
|
@ -162,7 +154,7 @@ function contact_mail($key, &$message, $params) {
|
|||
$message['body'][] = t("@sender-name (@sender-url) has sent you a message via your contact form at @site-name.", $variables, $options);
|
||||
$message['body'][] = t("If you don't want to receive such emails, you can change your settings at @recipient-edit-url.", $variables, $options);
|
||||
$build = entity_view($contact_message, 'mail');
|
||||
$message['body'][] = (string) \Drupal::service('renderer')->renderPlain($build);
|
||||
$message['body'][] = \Drupal::service('renderer')->renderPlain($build);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Access\ContactPageAccess.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Access;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
|
@ -79,7 +74,7 @@ class ContactPageAccess implements AccessInterface {
|
|||
}
|
||||
|
||||
// If requested user has been blocked, do not allow users to contact them.
|
||||
$access->cacheUntilEntityChanges($contact_account);
|
||||
$access->addCacheableDependency($contact_account);
|
||||
if ($contact_account->isBlocked()) {
|
||||
return $access;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\ContactFormAccessControlHandler.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\ContactFormEditForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\ContactFormInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\ContactFormListBuilder.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\ContactMessageAccessControlHandler.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Controller\ContactController.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Controller;
|
||||
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Entity\ContactForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Entity;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Entity\Message.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Entity;
|
||||
|
||||
use Drupal\Core\Entity\ContentEntityBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\MailHandler.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\MailHandlerException.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\MailHandlerInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\MessageForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Datetime\DateFormatterInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\MessageInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Entity\ContentEntityInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\MessageViewBuilder.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact;
|
||||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Plugin\migrate\source\ContactCategory.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Plugin\migrate\source;
|
||||
|
||||
use Drupal\migrate\Row;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Plugin\migrate\source\ContactSettings.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Plugin\migrate\source;
|
||||
|
||||
use Drupal\migrate_drupal\Plugin\migrate\source\Variable;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Plugin\views\field\ContactLink.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Plugin\views\field;
|
||||
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\ContactAuthenticatedUserTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\ContactLanguageTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\ContactPersonalTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
|
@ -232,11 +227,6 @@ class ContactPersonalTest extends WebTestBase {
|
|||
$flood_limit = 3;
|
||||
$this->config('contact.settings')->set('flood.limit', $flood_limit)->save();
|
||||
|
||||
// Clear flood table in preparation for flood test and allow other checks to complete.
|
||||
db_delete('flood')->execute();
|
||||
$num_records_flood = db_query("SELECT COUNT(*) FROM {flood}")->fetchField();
|
||||
$this->assertIdentical($num_records_flood, '0', 'Flood table emptied.');
|
||||
|
||||
$this->drupalLogin($this->webUser);
|
||||
|
||||
// Submit contact form with correct values and check flood interval.
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\ContactSitewideTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests;
|
||||
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
|
@ -185,10 +180,6 @@ class ContactSitewideTest extends WebTestBase {
|
|||
$this->assertNoRaw(t('Contact form %label has been added.', array('%label' => $label)));
|
||||
$this->assertRaw(t('The machine-readable name is already in use. It must be unique.'));
|
||||
|
||||
// Clear flood table in preparation for flood test and allow other checks to complete.
|
||||
db_delete('flood')->execute();
|
||||
$num_records_after = db_query("SELECT COUNT(*) FROM {flood}")->fetchField();
|
||||
$this->assertIdentical($num_records_after, '0', 'Flood table emptied.');
|
||||
$this->drupalLogout();
|
||||
|
||||
// Check to see that anonymous user cannot see contact page without permission.
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\ContactStorageTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests;
|
||||
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\Views\ContactFieldsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests\Views;
|
||||
|
||||
use Drupal\field\Entity\FieldConfig;
|
||||
use Drupal\views\Tests\ViewTestBase;
|
||||
use Drupal\field\Entity\FieldStorageConfig;
|
||||
use Drupal\contact\Entity\ContactForm;
|
||||
|
||||
/**
|
||||
* Tests which checks that no fieldapi fields are added on contact.
|
||||
|
@ -33,22 +31,22 @@ class ContactFieldsTest extends ViewTestBase {
|
|||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->fieldStorage = entity_create('field_storage_config', array(
|
||||
$this->fieldStorage = FieldStorageConfig::create(array(
|
||||
'field_name' => strtolower($this->randomMachineName()),
|
||||
'entity_type' => 'contact_message',
|
||||
'type' => 'text'
|
||||
));
|
||||
$this->fieldStorage->save();
|
||||
|
||||
entity_create('contact_form', array(
|
||||
ContactForm::create([
|
||||
'id' => 'contact_message',
|
||||
'label' => 'Test contact form',
|
||||
))->save();
|
||||
])->save();
|
||||
|
||||
entity_create('field_config', array(
|
||||
FieldConfig::create([
|
||||
'field_storage' => $this->fieldStorage,
|
||||
'bundle' => 'contact_message',
|
||||
))->save();
|
||||
])->save();
|
||||
|
||||
$this->container->get('views.views_data')->clear();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\Views\ContactLinkTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests\Views;
|
||||
|
||||
use Drupal\Core\Cache\Cache;
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\MessageEntityTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests;
|
||||
namespace Drupal\Tests\contact\Kernel;
|
||||
|
||||
use Drupal\system\Tests\Entity\EntityUnitTestBase;
|
||||
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
|
||||
|
||||
/**
|
||||
* Tests the message entity class.
|
||||
|
@ -14,7 +10,7 @@ use Drupal\system\Tests\Entity\EntityUnitTestBase;
|
|||
* @group contact
|
||||
* @see \Drupal\contact\Entity\Message
|
||||
*/
|
||||
class MessageEntityTest extends EntityUnitTestBase {
|
||||
class MessageEntityTest extends EntityKernelTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
|
@ -1,15 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\Migrate\MigrateContactCategoryTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests\Migrate;
|
||||
namespace Drupal\Tests\contact\Kernel\Migrate;
|
||||
|
||||
use Drupal\contact\Entity\ContactForm;
|
||||
use Drupal\contact\ContactFormInterface;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Migrate contact categories to contact.form.*.yml.
|
|
@ -1,14 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\Migrate\d6\MigrateContactCategoryTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests\Migrate\d6;
|
||||
namespace Drupal\Tests\contact\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\contact\Entity\ContactForm;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Migrate contact categories to contact.form.*.yml.
|
|
@ -1,14 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\Migrate\d6\MigrateContactSettingsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\contact\Tests\Migrate\d6;
|
||||
namespace Drupal\Tests\contact\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Upgrade variables to contact.settings.yml.
|
|
@ -1,13 +1,8 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\contact\Tests\Migrate\d7\MigrateContactSettingsTest.
|
||||
*/
|
||||
namespace Drupal\Tests\contact\Kernel\Migrate\d7;
|
||||
|
||||
namespace Drupal\contact\Tests\Migrate\d7;
|
||||
|
||||
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||
|
||||
/**
|
||||
* Tests migration of Contact settings to configuration.
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\contact\Unit\MailHandlerTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\contact\Unit;
|
||||
|
||||
use Drupal\contact\MailHandler;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\contact\Unit\Plugin\migrate\source\ContactCategoryTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\contact\Unit\Plugin\migrate\source;
|
||||
|
||||
use Drupal\contact\Plugin\migrate\source\ContactCategory;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\contact\Unit\Plugin\migrate\source\d6\ContactSettingsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\contact\Unit\Plugin\migrate\source\d6;
|
||||
|
||||
use Drupal\contact\Plugin\migrate\source\ContactSettings;
|
||||
|
|
Reference in a new issue