summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-03-24 23:06:30 (GMT)
committerAlex Pott2015-03-24 23:06:30 (GMT)
commit7d31cc867183285c7aa1d8dbf8337690bc9bd571 (patch)
tree4b37f13842dbc127e37b20880cc37808da04f2d4
parent0880f31cbe1deef689ecaf56c4e437de7f6587ac (diff)
Issue #1548204 by andypost, sun, typhonius, amateescu: Remove user signature and move it to contrib
-rw-r--r--core/CHANGELOG.txt1
-rw-r--r--core/modules/comment/comment.module7
-rw-r--r--core/modules/comment/src/CommentViewBuilder.php12
-rw-r--r--core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php1
-rw-r--r--core/modules/comment/src/Tests/CommentPreviewTest.php8
-rw-r--r--core/modules/comment/templates/comment.html.twig7
-rw-r--r--core/modules/migrate_drupal/config/install/migrate.migration.d6_user.yml17
-rw-r--r--core/modules/migrate_drupal/config/install/migrate.migration.d6_user_settings.yml2
-rw-r--r--core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php5
-rw-r--r--core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php1
-rw-r--r--core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php10
-rw-r--r--core/modules/user/config/install/user.settings.yml1
-rw-r--r--core/modules/user/config/schema/user.schema.yml3
-rw-r--r--core/modules/user/src/AccountForm.php31
-rw-r--r--core/modules/user/src/AccountSettingsForm.php10
-rw-r--r--core/modules/user/src/Entity/User.php58
-rw-r--r--core/modules/user/src/Tests/UserEditTest.php46
-rw-r--r--core/modules/user/src/Tests/UserRegistrationTest.php1
-rw-r--r--core/modules/user/src/Tests/UserSignatureTest.php174
-rw-r--r--core/modules/user/src/Tests/UserValidationTest.php8
-rw-r--r--core/modules/user/src/UserAccessControlHandler.php2
-rw-r--r--core/modules/user/src/UserInterface.php38
-rw-r--r--core/modules/user/src/UserViewsData.php18
-rw-r--r--core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php2
-rw-r--r--core/modules/user/user.module13
-rw-r--r--core/modules/views_ui/src/Tests/HandlerTest.php4
-rw-r--r--core/themes/bartik/templates/comment.html.twig4
-rw-r--r--core/themes/classy/templates/content/comment.html.twig7
28 files changed, 9 insertions, 482 deletions
diff --git a/core/CHANGELOG.txt b/core/CHANGELOG.txt
index 83fc766..34ba1f7 100644
--- a/core/CHANGELOG.txt
+++ b/core/CHANGELOG.txt
@@ -46,6 +46,7 @@ Drupal 8.0, xxxx-xx-xx (development version)
- Removed the Garland theme from core.
- Removed the Statistics module's accesslog functionality and reports from core.
- Removed XML-RPC functionality from core.
+- Removed user signatures support from core.
- Removed backwards-compatibility with 'magic_quotes_gpc'/'magic_quotes_runtime'
PHP configuration settings. Both are required to be disabled.
- Universally Unique IDentifier (UUID):
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 5ab742d..3ad9a0a 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -699,13 +699,6 @@ function template_preprocess_comment(&$variables) {
$variables['user_picture'] = array();
}
- if (isset($variables['elements']['signature'])) {
- $variables['signature'] = $variables['elements']['signature'];
- unset($variables['elements']['signature']);
- }
- else {
- $variables['signature'] = '';
- }
if (isset($comment->in_preview)) {
$variables['title'] = \Drupal::l($comment->getSubject(), new Url('<front>'));
$variables['permalink'] = \Drupal::l(t('Permalink'), new Url('<front>'));
diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php
index bf0f526..a247e02 100644
--- a/core/modules/comment/src/CommentViewBuilder.php
+++ b/core/modules/comment/src/CommentViewBuilder.php
@@ -102,18 +102,6 @@ class CommentViewBuilder extends EntityViewBuilder {
);
}
- $account = comment_prepare_author($entity);
- $config = \Drupal::config('user.settings');
- $build['#cache']['tags'] = Cache::mergeTags(isset($build['#cache']['tags']) ? $build['#cache']['tags'] : [], $config->getCacheTags());
- if ($config->get('signatures') && $account->getSignature()) {
- $build[$id]['signature'] = array(
- '#type' => 'processed_text',
- '#text' => $account->getSignature(),
- '#format' => $account->getSignatureFormat(),
- '#langcode' => $entity->language()->getId(),
- );
- }
-
if (!isset($build[$id]['#attached'])) {
$build[$id]['#attached'] = array();
}
diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
index 67cd4a7..3df2879 100644
--- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
@@ -110,7 +110,6 @@ class CommentDefaultFormatterCacheTagsTest extends EntityUnitTestBase {
'comment_view',
'comment:' . $comment->id(),
'config:filter.format.plain_text',
- 'config:user.settings',
'user_view',
'user:2',
);
diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/src/Tests/CommentPreviewTest.php
index ae65f88..d038514 100644
--- a/core/modules/comment/src/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/src/Tests/CommentPreviewTest.php
@@ -39,11 +39,8 @@ class CommentPreviewTest extends CommentTestBase {
$this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_THREADED, 'Comment paging changed.');
$this->drupalLogout();
- // Login as web user and add a signature and a user picture.
+ // Login as web user and add a user picture.
$this->drupalLogin($this->webUser);
- $this->config('user.settings')->set('signatures', 1)->save();
- $test_signature = $this->randomMachineName();
- $edit['signature[value]'] = '<a href="http://example.com/">' . $test_signature. '</a>';
$image = current($this->drupalGetTestFiles('image'));
$edit['files[user_picture_0]'] = drupal_realpath($image->uri);
$this->drupalPostForm('user/' . $this->webUser->id() . '/edit', $edit, t('Save'));
@@ -63,9 +60,6 @@ class CommentPreviewTest extends CommentTestBase {
$this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.');
$this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.');
- // Check that the signature is displaying with the correct text format.
- $this->assertLink($test_signature);
-
// Check that the user picture is displayed.
$this->assertFieldByXPath("//article[contains(@class, 'preview')]//div[contains(@class, 'user-picture')]//img", NULL, 'User picture displayed.');
}
diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig
index 75604b9..3a7d19b 100644
--- a/core/modules/comment/templates/comment.html.twig
+++ b/core/modules/comment/templates/comment.html.twig
@@ -22,7 +22,6 @@
* - submitted: Submission information created from author and created
* during template_preprocess_comment().
* - user_picture: The comment author's profile picture.
- * - signature: The comment author's signature.
* - status: Comment status. Possible values are:
* unpublished, published, or preview.
* - title: Comment title, linked to the comment.
@@ -103,12 +102,6 @@
<div{{ content_attributes }}>
{{ content|without('links') }}
-
- {% if signature %}
- <div>
- {{ signature }}
- </div>
- {% endif %}
</div>
{% if content.links %}
{{ content.links }}
diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user.yml
index 7864f09..99302ec 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user.yml
@@ -22,22 +22,6 @@ process:
plugin: migration
migration: d6_user_role
source: roles
- signature: signature
- signature_format:
- -
-# Drupal 6 stores 0 as the signature format when signatures are disabled.
-# Drupal 8 stores a NULL.
- plugin: static_map
- bypass: true
- source: signature_format
- map:
- 0: NULL
- -
-# Do not try to migrate the NULL format.
- plugin: skip_process_on_empty
- -
- plugin: migration
- migration: d6_filter_format
user_picture:
plugin: d6_user_picture
source: uid
@@ -46,7 +30,6 @@ destination:
md5_passwords: true
migration_dependencies:
required:
- - d6_filter_format
- d6_user_role
optional:
- d6_user_picture_file
diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_settings.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_settings.yml
index 557dc8c..274288b 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_settings.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_settings.yml
@@ -7,14 +7,12 @@ source:
variables:
- user_mail_status_blocked_notify
- user_mail_status_activated_notify
- - user_signatures
- user_email_verification
- user_register
- anonymous
process:
'notify/status_blocked': user_mail_status_blocked_notify
'notify/status_activated': user_mail_status_activated_notify
- signatures: user_signatures
verify_mail: user_email_verification
register:
plugin: static_map
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
index f04672d..22fec2f 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
@@ -134,8 +134,9 @@ class LoadEntity extends PluginBase implements MigrateLoadInterface {
$migration->setProcessOfProperty("$field_name/value", $value_key);
- // See d6_user, signature_format for an example of the YAML that
- // represents this process array.
+ // See \Drupal\migrate_drupal\Plugin\migrate\source\d6\User::baseFields(),
+ // signature_format for an example of the YAML that represents this
+ // process array.
$process = [
[
'plugin' => 'static_map',
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
index 21396c6..0c9636a 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
@@ -67,7 +67,6 @@ class MigrateUserConfigsTest extends MigrateDrupal6TestBase {
$config = $this->config('user.settings');
$this->assertIdentical(TRUE, $config->get('notify.status_blocked'));
$this->assertIdentical(FALSE, $config->get('notify.status_activated'));
- $this->assertIdentical(TRUE, $config->get('signatures'));
$this->assertIdentical(FALSE, $config->get('verify_mail'));
$this->assertIdentical('admin_only', $config->get('register'));
$this->assertIdentical('Guest', $config->get('anonymous'));
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
index 24ac4f9..5ed9a9b 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
@@ -100,11 +100,6 @@ class MigrateUserTest extends MigrateDrupal6TestBase {
$this->loadDumps($dumps);
$id_mappings = array(
- 'd6_filter_format' => array(
- array(array(1), array('filtered_html')),
- array(array(2), array('full_html')),
- array(array(3), array('escape_html_filter')),
- ),
'd6_user_role' => array(
array(array(1), array('anonymous user')),
array(array(2), array('authenticated user')),
@@ -156,16 +151,11 @@ class MigrateUserTest extends MigrateDrupal6TestBase {
$role = $migration_role->getIdMap()->lookupDestinationId(array($rid));
$roles[] = reset($role);
}
- // Get the user signature format.
- $migration_format = entity_load('migration', 'd6_filter_format');
- $signature_format = $source->signature_format === '0' ? [NULL] : $migration_format->getIdMap()->lookupDestinationId(array($source->signature_format));
$user = User::load($source->uid);
$this->assertIdentical($source->uid, $user->id());
$this->assertIdentical($source->name, $user->label());
$this->assertIdentical($source->mail, $user->getEmail());
- $this->assertIdentical($source->signature, $user->getSignature());
- $this->assertIdentical(reset($signature_format), $user->getSignatureFormat());
$this->assertIdentical($source->created, $user->getCreatedTime());
$this->assertIdentical($source->access, $user->getLastAccessedTime());
$this->assertIdentical($source->login, $user->getLastLoginTime());
diff --git a/core/modules/user/config/install/user.settings.yml b/core/modules/user/config/install/user.settings.yml
index 788d95a..8372ccd 100644
--- a/core/modules/user/config/install/user.settings.yml
+++ b/core/modules/user/config/install/user.settings.yml
@@ -10,7 +10,6 @@ notify:
register_no_approval_required: true
register_pending_approval: true
register: visitors
-signatures: false
cancel_method: user_cancel_block
password_reset_timeout: 86400
password_strength: true
diff --git a/core/modules/user/config/schema/user.schema.yml b/core/modules/user/config/schema/user.schema.yml
index f38fd4c..09e5989 100644
--- a/core/modules/user/config/schema/user.schema.yml
+++ b/core/modules/user/config/schema/user.schema.yml
@@ -41,9 +41,6 @@ user.settings:
register:
type: string
label: 'Who can register accounts?'
- signatures:
- type: boolean
- label: 'Enable signatures'
cancel_method:
type: string
label: 'When cancelling a user account'
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index 8c14682..4c6db06 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -232,29 +232,6 @@ abstract class AccountForm extends ContentEntityForm {
'#access' => $register && $admin,
);
- // Signature.
- $form['signature_settings'] = array(
- '#type' => 'details',
- '#title' => $this->t('Signature settings'),
- '#open' => TRUE,
- '#weight' => 1,
- '#access' => (!$register && $config->get('signatures')),
- );
- // While the details group will simply not be rendered if empty, the actual
- // signature element cannot use #access, since #type 'text_format' is not
- // available when Filter module is not installed. If the user account has an
- // existing signature value and format, then the existing field values will
- // just be re-saved to the database in case of an entity update.
- if ($this->moduleHandler->moduleExists('filter')) {
- $form['signature_settings']['signature'] = array(
- '#type' => 'text_format',
- '#title' => $this->t('Signature'),
- '#default_value' => $account->getSignature(),
- '#description' => $this->t('Your signature will be publicly displayed at the end of your comments.'),
- '#format' => $account->getSignatureFormat(),
- );
- }
-
$user_preferred_langcode = $register ? $language_interface->getId() : $account->getPreferredLangcode();
$user_preferred_admin_langcode = $register ? $language_interface->getId() : $account->getPreferredAdminLangcode(FALSE);
@@ -365,12 +342,6 @@ abstract class AccountForm extends ContentEntityForm {
/** @var \Drupal\user\UserInterface $account */
$account = parent::buildEntity($form, $form_state);
- // Take care of mapping signature form element values as their structure
- // does not directly match the field structure.
- $signature = $form_state->getValue('signature');
- $account->setSignature($signature['value']);
- $account->setSignatureFormat($signature['format']);
-
// Translate the empty value '' of language selects to an unset field.
foreach (array('preferred_langcode', 'preferred_admin_langcode') as $field_name) {
if ($form_state->getValue($field_name) === '') {
@@ -393,8 +364,6 @@ abstract class AccountForm extends ContentEntityForm {
$field_names = array(
'name',
'mail',
- 'signature',
- 'signature_format',
'timezone',
'langcode',
'preferred_langcode',
diff --git a/core/modules/user/src/AccountSettingsForm.php b/core/modules/user/src/AccountSettingsForm.php
index 38c39e6..df65cb8 100644
--- a/core/modules/user/src/AccountSettingsForm.php
+++ b/core/modules/user/src/AccountSettingsForm.php
@@ -194,12 +194,6 @@ class AccountSettingsForm extends ConfigFormBase {
'#open' => TRUE,
'#access' => $filter_exists,
);
- $form['personalization']['user_signatures'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Enable signatures'),
- '#default_value' => $filter_exists ? $config->get('signatures') : 0,
- '#access' => $filter_exists,
- );
// Default notifications address.
$form['mail_notification_address'] = array(
@@ -450,7 +444,6 @@ class AccountSettingsForm extends ConfigFormBase {
->set('register', $form_state->getValue('user_register'))
->set('password_strength', $form_state->getValue('user_password_strength'))
->set('verify_mail', $form_state->getValue('user_email_verification'))
- ->set('signatures', $form_state->getValue('user_signatures'))
->set('cancel_method', $form_state->getValue('user_cancel_method'))
->set('notify.status_activated', $form_state->getValue('user_mail_status_activated_notify'))
->set('notify.status_blocked', $form_state->getValue('user_mail_status_blocked_notify'))
@@ -493,9 +486,6 @@ class AccountSettingsForm extends ConfigFormBase {
$this->roleStorage->load($new_admin_role)->setIsAdmin(TRUE)->save();
}
}
-
- // Clear field definition cache for signatures.
- \Drupal::entityManager()->clearCachedFieldDefinitions();
}
}
diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php
index 96b40ee..1cecfdc 100644
--- a/core/modules/user/src/Entity/User.php
+++ b/core/modules/user/src/Entity/User.php
@@ -286,36 +286,6 @@ class User extends ContentEntityBase implements UserInterface {
/**
* {@inheritdoc}
*/
- public function getSignature() {
- return $this->get('signature')->value;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setSignature($signature) {
- $this->get('signature')->value = $signature;
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSignatureFormat() {
- return $this->get('signature_format')->value;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setSignatureFormat($signature_format) {
- $this->get('signature_format')->value = $signature_format;
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
public function getCreatedTime() {
return $this->get('created')->value;
}
@@ -525,20 +495,6 @@ class User extends ContentEntityBase implements UserInterface {
->addConstraint('UserMailUnique')
->addConstraint('UserMailRequired');
- // @todo Convert to a text field in https://drupal.org/node/1548204.
- $fields['signature'] = BaseFieldDefinition::create('string')
- ->setLabel(t('Signature'))
- ->setDescription(t('The signature of this user.'))
- ->setTranslatable(TRUE);
- $fields['signature_format'] = BaseFieldDefinition::create('string')
- ->setLabel(t('Signature format'))
- ->setDescription(t('The signature format of this user.'))
- // @todo: Define this via an options provider once
- // https://www.drupal.org/node/2329937 is completed.
- ->addPropertyConstraints('value', array(
- 'AllowedValues' => array('callback' => __CLASS__ . '::getAllowedSignatureFormats'),
- ));
-
$fields['timezone'] = BaseFieldDefinition::create('string')
->setLabel(t('Timezone'))
->setDescription(t('The timezone of this user.'))
@@ -597,20 +553,6 @@ class User extends ContentEntityBase implements UserInterface {
}
/**
- * Defines allowed signature formats for the field's AllowedValues constraint.
- *
- * @return string[]
- * The allowed values.
- */
- public static function getAllowedSignatureFormats() {
- if (\Drupal::moduleHandler()->moduleExists('filter')) {
- return array_keys(filter_formats());
- }
- // If filter.module is disabled, no value may be assigned.
- return array();
- }
-
- /**
* Defines allowed timezones for the field's AllowedValues constraint.
*
* @return string[]
diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php
index 38acdb8..308fad9 100644
--- a/core/modules/user/src/Tests/UserEditTest.php
+++ b/core/modules/user/src/Tests/UserEditTest.php
@@ -17,50 +17,11 @@ use Drupal\simpletest\WebTestBase;
class UserEditTest extends WebTestBase {
/**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = array('filter');
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
-
- $this->config('user.settings')->set('signatures', TRUE)->save();
-
- // Prefetch and create text formats.
- $this->filtered_html_format = entity_create('filter_format', array(
- 'format' => 'filtered_html_format',
- 'name' => 'Filtered HTML',
- 'weight' => -1,
- 'filters' => array(
- 'filter_html' => array(
- 'module' => 'filter',
- 'status' => TRUE,
- 'settings' => array(
- 'allowed_html' => '<a> <em> <strong>',
- ),
- ),
- ),
- ));
- $this->filtered_html_format->save();
-
- $this->full_html_format = entity_create('filter_format', array(
- 'format' => 'full_html',
- 'name' => 'Full HTML',
- ));
- $this->full_html_format->save();
- }
-
- /**
* Test user edit page.
*/
function testUserEdit() {
// Test user edit functionality.
- $user1 = $this->drupalCreateUser(array('change own username', $this->full_html_format->getPermissionName(), $this->filtered_html_format->getPermissionName()));
+ $user1 = $this->drupalCreateUser(array('change own username'));
$user2 = $this->drupalCreateUser(array());
$this->drupalLogin($user1);
@@ -124,11 +85,6 @@ class UserEditTest extends WebTestBase {
$config->set('password_strength', FALSE)->save();
$this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
$this->assertNoRaw(t('Password strength:'), 'The password strength indicator is not displayed.');
-
- // Test user signature
- $edit = array('signature[format]' => $this->full_html_format->id(), 'signature[value]' => $this->randomString(256));
- $this->drupalPostForm('user/' . $user1->id() . '/edit', $edit, t('Save'));
- $this->assertRaw(t("%name: may not be longer than @max characters.", array('%name' => t('Signature'), '@max' => 255)));
}
/**
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index 447a7cb..2666665 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -184,7 +184,6 @@ class UserRegistrationTest extends WebTestBase {
$new_user = reset($accounts);
$this->assertEqual($new_user->getUsername(), $name, 'Username matches.');
$this->assertEqual($new_user->getEmail(), $mail, 'Email address matches.');
- $this->assertEqual($new_user->getSignature(), '', 'Correct signature field.');
$this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.');
$this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.');
$this->assertEqual($new_user->getTimezone(), $config_system_date->get('timezone.default'), 'Correct time zone field.');
diff --git a/core/modules/user/src/Tests/UserSignatureTest.php b/core/modules/user/src/Tests/UserSignatureTest.php
deleted file mode 100644
index 47b1636..0000000
--- a/core/modules/user/src/Tests/UserSignatureTest.php
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of Drupal\user\Tests\UserSignatureTest.
- */
-
-namespace Drupal\user\Tests;
-
-use Drupal\comment\Tests\CommentTestTrait;
-use Drupal\simpletest\WebTestBase;
-use Drupal\user\RoleInterface;
-
-/**
- * Tests case for user signatures.
- *
- * @group user
- */
-class UserSignatureTest extends WebTestBase {
-
- use CommentTestTrait;
-
- /**
- * A regular user.
- *
- * @var \Drupal\user\UserInterface
- */
- protected $webUser;
-
- /**
- * User with admin privileges.
- *
- * @var \Drupal\user\UserInterface
- */
- protected $adminUser;
-
- /**
- * Filtered HTML format.
- *
- * @var \Drupal\filter\FilterFormatInterface
- */
- protected $filteredHtmlFormat;
-
- /**
- * Full HTML format.
- *
- * @var \Drupal\filter\FilterFormatInterface
- */
- protected $fullHtmlFormat;
-
- /**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = array('node', 'comment', 'field_ui');
-
- protected function setUp() {
- parent::setUp();
-
- // Enable user signatures.
- $this->config('user.settings')->set('signatures', 1)->save();
-
- // Create Basic page node type.
- $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- // Add a comment field with commenting enabled by default.
- $this->addDefaultCommentField('node', 'page');
-
- // Prefetch and create text formats.
- $this->filteredHtmlFormat = entity_create('filter_format', array(
- 'format' => 'filtered_html_format',
- 'name' => 'Filtered HTML',
- 'weight' => -1,
- 'filters' => array(
- 'filter_html' => array(
- 'module' => 'filter',
- 'status' => TRUE,
- 'settings' => array(
- 'allowed_html' => '<a> <em> <strong>',
- ),
- ),
- ),
- ));
- $this->filteredHtmlFormat->save();
-
- $this->fullHtmlFormat = entity_create('filter_format', array(
- 'format' => 'full_html',
- 'name' => 'Full HTML',
- ));
- $this->fullHtmlFormat->save();
-
- user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array($this->filteredHtmlFormat->getPermissionName()));
-
- // Create regular and administrative users.
- $this->webUser = $this->drupalCreateUser(array('post comments'));
-
- $admin_permissions = array('post comments', 'administer comments', 'administer user form display', 'administer account settings');
- foreach (filter_formats() as $format) {
- if ($permission = $format->getPermissionName()) {
- $admin_permissions[] = $permission;
- }
- }
- $this->adminUser = $this->drupalCreateUser($admin_permissions);
- }
-
- /**
- * Test that a user can change their signature format and that it is respected
- * upon display.
- */
- function testUserSignature() {
- $node = $this->drupalCreateNode(array(
- 'body' => array(
- 0 => array(
- 'value' => $this->randomMachineName(32),
- 'format' => 'full_html',
- ),
- ),
- ));
-
- // Verify that user signature field is not displayed on registration form.
- $this->drupalGet('user/register');
- $this->assertNoText(t('Signature'));
-
- // Log in as a regular user and create a signature.
- $this->drupalLogin($this->webUser);
- $signature_text = "<h1>" . $this->randomMachineName() . "</h1>";
- $edit = array(
- 'signature[value]' => $signature_text,
- );
- $this->drupalPostForm('user/' . $this->webUser->id() . '/edit', $edit, t('Save'));
-
- // Verify that values were stored.
- $this->assertFieldByName('signature[value]', $edit['signature[value]'], 'Submitted signature text found.');
-
- // Verify that the user signature's text format's cache tag is absent.
- $this->drupalGet('node/' . $node->id());
- $this->assertTrue(!in_array('filter_format:filtered_html_format', explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'))));
-
- // Create a comment.
- $edit = array();
- $edit['subject[0][value]'] = $this->randomMachineName(8);
- $edit['comment_body[0][value]'] = $this->randomMachineName(16);
- $this->drupalPostForm('comment/reply/node/' . $node->id() .'/comment', $edit, t('Preview'));
- $this->drupalPostForm(NULL, array(), t('Save'));
-
- // Get the comment ID. (This technique is the same one used in the Comment
- // module's CommentTestBase test case.)
- preg_match('/#comment-([0-9]+)/', $this->getURL(), $match);
- $comment_id = $match[1];
-
- // Log in as an administrator and edit the comment to use Full HTML, so
- // that the comment text itself is not filtered at all.
- $this->drupalLogin($this->adminUser);
- $edit['comment_body[0][format]'] = $this->fullHtmlFormat->id();
- $this->drupalPostForm('comment/' . $comment_id . '/edit', $edit, t('Save'));
-
- // Assert that the signature did not make it through unfiltered.
- $this->drupalGet('node/' . $node->id());
- $this->assertNoRaw($signature_text, 'Unfiltered signature text not found.');
- $this->assertRaw(check_markup($signature_text, $this->filteredHtmlFormat->id()), 'Filtered signature text found.');
- // Verify that the user signature's text format's cache tag is present.
- $this->drupalGet('node/' . $node->id());
- $this->assertTrue(in_array('config:filter.format.filtered_html_format', explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'))));
-
- // Verify the signature field is available on Manage form display page.
- $this->config('user.settings')->set('signatures', 0)->save();
- \Drupal::entityManager()->clearCachedFieldDefinitions();
- $this->drupalGet('admin/config/people/accounts/form-display');
- $this->assertNoText('Signature settings');
- $this->drupalPostForm('admin/config/people/accounts', array('user_signatures' => TRUE), t('Save configuration'));
- $this->drupalGet('admin/config/people/accounts/form-display');
- $this->assertText('Signature settings');
- }
-}
diff --git a/core/modules/user/src/Tests/UserValidationTest.php b/core/modules/user/src/Tests/UserValidationTest.php
index acc64b7..d0d4864 100644
--- a/core/modules/user/src/Tests/UserValidationTest.php
+++ b/core/modules/user/src/Tests/UserValidationTest.php
@@ -139,14 +139,6 @@ class UserValidationTest extends KernelTestBase {
$this->assertEqual($violations[0]->getMessage(), t('!name field is required.', array('!name' => String::placeholder($user->getFieldDefinition('mail')->getLabel()))));
$user->set('mail', 'someone@example.com');
- $user->set('signature', $this->randomString(256));
- $this->assertLengthViolation($user, 'signature', 255);
- $user->set('signature', NULL);
-
- $user->set('signature_format', $this->randomString(32));
- $this->assertAllowedValuesViolation($user, 'signature_format');
- $user->set('signature_format', NULL);
-
$user->set('timezone', $this->randomString(33));
$this->assertLengthViolation($user, 'timezone', 32, 2, 1);
$user->set('timezone', 'invalid zone');
diff --git a/core/modules/user/src/UserAccessControlHandler.php b/core/modules/user/src/UserAccessControlHandler.php
index 91d163e..ab104f0 100644
--- a/core/modules/user/src/UserAccessControlHandler.php
+++ b/core/modules/user/src/UserAccessControlHandler.php
@@ -95,8 +95,6 @@ class UserAccessControlHandler extends EntityAccessControlHandler {
case 'preferred_langcode':
case 'preferred_admin_langcode':
- case 'signature':
- case 'signature_format':
case 'timezone':
case 'mail':
// Allow view access to own mail address and other personalization
diff --git a/core/modules/user/src/UserInterface.php b/core/modules/user/src/UserInterface.php
index c6f3b2a..0797776 100644
--- a/core/modules/user/src/UserInterface.php
+++ b/core/modules/user/src/UserInterface.php
@@ -87,44 +87,6 @@ interface UserInterface extends ContentEntityInterface, EntityChangedInterface,
public function setEmail($mail);
/**
- * Returns the user signature.
- *
- * @todo: Convert this to a configurable field.
- *
- * @return string
- * The signature text.
- */
- public function getSignature();
-
- /**
- * Sets the user signature.
- *
- * @param string $signature
- * The new signature text of the user.
- *
- * @return $this
- */
- public function setSignature($signature);
-
- /**
- * Returns the signature format.
- *
- * @return string
- * Name of the filter format.
- */
- public function getSignatureFormat();
-
- /**
- * Sets the signature format.
- *
- * @param string $signature_format
- * The name of the new filter format.
- *
- * @return $this
- */
- public function setSignatureFormat($signature_format);
-
- /**
* Returns the creation time of the user as a UNIX timestamp.
*
* @return int
diff --git a/core/modules/user/src/UserViewsData.php b/core/modules/user/src/UserViewsData.php
index e043ac1..621da71 100644
--- a/core/modules/user/src/UserViewsData.php
+++ b/core/modules/user/src/UserViewsData.php
@@ -218,24 +218,6 @@ class UserViewsData extends EntityViewsData {
),
);
- unset($data['users_field_data']['signature']);
- unset($data['users_field_data']['signature_format']);
-
- if (\Drupal::moduleHandler()->moduleExists('filter')) {
- $data['users_field_data']['signature'] = array(
- 'title' => t('Signature'),
- 'help' => t("The user's signature."),
- 'field' => array(
- 'id' => 'markup',
- 'format' => filter_fallback_format(),
- 'click sortable' => FALSE,
- ),
- 'filter' => array(
- 'id' => 'string',
- ),
- );
- }
-
if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
$data['users']['translation_link'] = array(
'title' => t('Translation link'),
diff --git a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
index 04cdef9..79463bc 100644
--- a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
@@ -205,8 +205,6 @@ class UserAccessControlHandlerTest extends UnitTestCase {
$fields = array(
'preferred_langcode',
'preferred_admin_langcode',
- 'signature',
- 'signature_format',
'timezone',
'mail',
);
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 665b43d..2f00cfe 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -62,7 +62,7 @@ function user_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dt>' . t('Setting permissions') . '</dt>';
$output .= '<dd>' . t('After creating roles, you can set permissions for each role on the <a href="!permissions_user">Permissions page</a>. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing content, editing or creating a particular type of content, administering settings for a particular module, or using a particular function of the site (such as search).', array('!permissions_user' => \Drupal::url('user.admin_permissions'))) . '</dd>';
$output .= '<dt>' . t('Managing account settings') . '</dt>';
- $output .= '<dd>' . t('The <a href="!accounts">Account settings page</a> allows you to manage settings for the displayed name of the Anonymous user role, personal contact forms, user registration settings, and account cancellation settings. On this page you can also manage settings for account personalization (including signatures), and adapt the text for the email messages that users receive when they register or request a password recovery. You may also set which role is automatically assigned new permissions whenever a module is enabled (the Administrator role).', array('!accounts' => \Drupal::url('entity.user.admin_form'))) . '</dd>';
+ $output .= '<dd>' . t('The <a href="!accounts">Account settings page</a> allows you to manage settings for the displayed name of the Anonymous user role, personal contact forms, user registration settings, and account cancellation settings. On this page you can also manage settings for account personalization, and adapt the text for the email messages that users receive when they register or request a password recovery. You may also set which role is automatically assigned new permissions whenever a module is enabled (the Administrator role).', array('!accounts' => \Drupal::url('entity.user.admin_form'))) . '</dd>';
$output .= '<dt>' . t('Managing user account fields') . '</dt>';
$output .= '<dd>' . t('Because User accounts are an entity type, you can extend them by adding fields through the Manage fields tab on the <a href="!accounts">Account settings page</a>. By adding fields for e.g., a picture, a biography, or address, you can a create a custom profile for the users of the website. For background information on entities and fields, see the <a href="!field_help">Field module help page</a>.', array('!field_help'=>\Drupal::url('help.page', array('name' => 'field')), '!accounts' => \Drupal::url('entity.user.admin_form'))) . '</dd>';
$output .= '</dl>';
@@ -168,13 +168,6 @@ function user_entity_extra_field_info() {
'description' => t('User module account form elements.'),
'weight' => -10,
);
- if (\Drupal::config('user.settings')->get('signatures')) {
- $fields['user']['user']['form']['signature_settings'] = array(
- 'label' => t('Signature settings'),
- 'description' => t('User module form element.'),
- 'weight' => 1,
- );
- }
$fields['user']['user']['form']['language'] = array(
'label' => t('Language settings'),
'description' => t('User module form element.'),
@@ -1337,10 +1330,6 @@ function user_form_process_password_confirm($element) {
function user_modules_uninstalled($modules) {
// Remove any potentially orphan module data stored for users.
\Drupal::service('user.data')->delete($modules);
- // User signatures require Filter module.
- if (in_array('filter', $modules)) {
- \Drupal::configFactory()->getEditable('user.settings')->set('signatures', FALSE)->save();
- }
}
/**
diff --git a/core/modules/views_ui/src/Tests/HandlerTest.php b/core/modules/views_ui/src/Tests/HandlerTest.php
index 4c9c786..eebd4ed 100644
--- a/core/modules/views_ui/src/Tests/HandlerTest.php
+++ b/core/modules/views_ui/src/Tests/HandlerTest.php
@@ -123,8 +123,8 @@ class HandlerTest extends UITestBase {
$add_handler_url = "admin/structure/views/nojs/add-handler/test_view_empty/default/field";
$type_info = $handler_types['field'];
- $this->drupalPostForm($add_handler_url, array('name[users_field_data.signature]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle'])));
- $id = 'signature';
+ $this->drupalPostForm($add_handler_url, array('name[users_field_data.name]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle'])));
+ $id = 'name';
$edit_handler_url = "admin/structure/views/nojs/handler/test_view_empty/default/field/$id";
$this->assertUrl($edit_handler_url, array(), 'The user got redirected to the handler edit form.');
diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig
index 1d6718d..21cca3c 100644
--- a/core/themes/bartik/templates/comment.html.twig
+++ b/core/themes/bartik/templates/comment.html.twig
@@ -22,7 +22,6 @@
* - submitted: Submission information created from author and created
* during template_preprocess_comment().
* - user_picture: The comment author's profile picture.
- * - signature: The comment author's signature.
* - status: Comment status. Possible values are:
* unpublished, published, or preview.
* - title: Comment title, linked to the comment.
@@ -108,9 +107,6 @@
{{ content|without('links') }}
</div>
<footer class="comment__footer">
- {% if signature %}
- <div class="user-signature clearfix">{{ signature }}</div>
- {% endif %}
{% if content.links %}
<nav>{{ content.links }}</nav>
{% endif %}
diff --git a/core/themes/classy/templates/content/comment.html.twig b/core/themes/classy/templates/content/comment.html.twig
index 6b521a5..97baf55 100644
--- a/core/themes/classy/templates/content/comment.html.twig
+++ b/core/themes/classy/templates/content/comment.html.twig
@@ -22,7 +22,6 @@
* - submitted: Submission information created from author and created
* during template_preprocess_comment().
* - user_picture: The comment author's profile picture.
- * - signature: The comment author's signature.
* - status: Comment status. Possible values are:
* unpublished, published, or preview.
* - title: Comment title, linked to the comment.
@@ -109,12 +108,6 @@
<div{{ content_attributes.addClass('content') }}>
{{ content|without('links') }}
-
- {% if signature %}
- <div class="user-signature">
- {{ signature }}
- </div>
- {% endif %}
</div>
{% if content.links %}
{{ content.links }}