diff --git a/core/CHANGELOG.txt b/core/CHANGELOG.txt index 83fc76658f9a8f8ab9312aed63ed6eeef78c8635..34ba1f74ba6a7238a5bf9763874a38e473265833 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 5ab742d5f195b367b1cdf63583c735bdbbf618b8..3ad9a0accae549e93f69c2c6cd8689ea7ffdd2fe 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('')); $variables['permalink'] = \Drupal::l(t('Permalink'), new Url('')); diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php index bf0f5260303e464debe44caf08d25ce383488eff..a247e024239f0112ca094a19c533319501a2bf52 100644 --- a/core/modules/comment/src/CommentViewBuilder.php +++ b/core/modules/comment/src/CommentViewBuilder.php @@ -102,18 +102,6 @@ public function buildComponents(array &$build, array $entities, array $displays, ); } - $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 67cd4a7bf18892bc7942caa4ffc517079e6af229..3df2879701473ad7718278738eebbf28b205e038 100644 --- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php +++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php @@ -110,7 +110,6 @@ public function testCacheTags() { '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 ae65f88155143770209ca2d0fb509614448acdc4..d038514732e60bb11707693575bec97635e8452f 100644 --- a/core/modules/comment/src/Tests/CommentPreviewTest.php +++ b/core/modules/comment/src/Tests/CommentPreviewTest.php @@ -39,11 +39,8 @@ function testCommentPreview() { $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]'] = '' . $test_signature. ''; $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 @@ function testCommentPreview() { $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 75604b919d927c9a0b6c25ec8a66140a08caf8e8..3a7d19b9e8ed0e1addeecc2d25de86b67bfc8708 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 @@ {{ content|without('links') }} - - {% if signature %} -
- {{ signature }} -
- {% endif %} {% 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 7864f0965f794165de476f2a165d2e21674c1694..99302ec27bc7d76580d48f1984f23617c5e74fe3 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 557dc8cc271b6320af0076fd6951541f87bfc3ae..274288b90e4d1e7a29316d25218dd0d1c4dc606e 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 f04672dbcdd232c1855e98919e2bb138bb9309f5..22fec2f1191049035599e9cd25196acf8997fcc4 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 @@ protected function processTextField($field_name, $field_data, MigrationInterface $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 21396c6081c00e90d80b208f903de72e32d59362..0c9636a0828e3db0294daf75b223a0670e81920f 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 @@ public function testUserSettings() { $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 24ac4f9819b3a34177064cc43232da736fd4acba..5ed9a9b8bf4ee043a763df16aec4b20c2b48e6ec 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 @@ protected function setUp() { $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 @@ public function testUser() { $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 788d95a7ce9414b98db4f64e7ae1bb51ac0025fe..8372ccdb73a9839a78f39b42f346c7d8ffc985ac 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 f38fd4cfb13b9fae254a4f82d5e0cddabddc9f59..09e5989e971445551286e15970ce4bc7e45dba10 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 8c146823fb98fa8683130aaf3115cf2e1954eae9..4c6db065a3dcba645c586b84d93bb18552b0662d 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -232,29 +232,6 @@ public function form(array $form, FormStateInterface $form_state) { '#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 @@ public function buildEntity(array $form, FormStateInterface $form_state) { /** @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 @@ public function validate(array $form, FormStateInterface $form_state) { $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 38c39e654c8b421dcdf8bb9cfea8dd710734f378..df65cb8ff64cbfac4e472547c0275b57fa2668d8 100644 --- a/core/modules/user/src/AccountSettingsForm.php +++ b/core/modules/user/src/AccountSettingsForm.php @@ -194,12 +194,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#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 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ->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 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $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 96b40eed302fc38e5ce69b29e714a0d3d81d14e1..1cecfdc64a68d82ccf4e08aa9edf89b2d2d4bea9 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -283,36 +283,6 @@ public function setEmail($mail) { return $this; } - /** - * {@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} */ @@ -525,20 +495,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->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.')) @@ -596,20 +552,6 @@ protected function getRoleStorage() { return \Drupal::entityManager()->getStorage('user_role'); } - /** - * 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. * diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php index 38acdb8f10130a81ce048c25a7adb5342f374b63..308fad96d767e04b64abe20317ee00081c3f2611 100644 --- a/core/modules/user/src/Tests/UserEditTest.php +++ b/core/modules/user/src/Tests/UserEditTest.php @@ -16,51 +16,12 @@ */ 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' => ' ', - ), - ), - ), - )); - $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 @@ function testUserEdit() { $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 447a7cbff3f246156b40e3c3f7c792a8767f1da5..26666653367ce8ab5aa9abf27bfcc9f699e7666b 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -184,7 +184,6 @@ function testRegistrationDefaultValues() { $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 47b1636d6ab719ffb3eb281dcd3ac58818c93c7e..0000000000000000000000000000000000000000 --- a/core/modules/user/src/Tests/UserSignatureTest.php +++ /dev/null @@ -1,174 +0,0 @@ -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' => ' ', - ), - ), - ), - )); - $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 = "

" . $this->randomMachineName() . "

"; - $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 acc64b76d0c456c193c656c870be175389daa669..d0d486463989bd44dc03e51fd19f25727117b08e 100644 --- a/core/modules/user/src/Tests/UserValidationTest.php +++ b/core/modules/user/src/Tests/UserValidationTest.php @@ -139,14 +139,6 @@ function testValidation() { $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 91d163ecd513339866b2e64e52b45651d044e524..ab104f069dae967e1fc887dfa718a35ca193fd83 100644 --- a/core/modules/user/src/UserAccessControlHandler.php +++ b/core/modules/user/src/UserAccessControlHandler.php @@ -95,8 +95,6 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_ 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 c6f3b2af3b684851266f7d2c2caf299e079ce829..079777635bb4f3bb638a4094e4cb2fe915662cb8 100644 --- a/core/modules/user/src/UserInterface.php +++ b/core/modules/user/src/UserInterface.php @@ -86,44 +86,6 @@ public function setPassword($password); */ 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. * diff --git a/core/modules/user/src/UserViewsData.php b/core/modules/user/src/UserViewsData.php index e043ac14aab92e71618743eac6dfd25aa4b042b7..621da71f601ac284eef64af27cf6d83b8617f976 100644 --- a/core/modules/user/src/UserViewsData.php +++ b/core/modules/user/src/UserViewsData.php @@ -218,24 +218,6 @@ public function getViewsData() { ), ); - 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 04cdef9bed8f60b0f16dbf6d1172b311b209c5e4..79463bc7ff0e46cb1dd8ee3a015b3bf1ead9bc5c 100644 --- a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php +++ b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php @@ -205,8 +205,6 @@ public function hiddenUserSettingsProvider() { $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 665b43d2b10465ce88ed75a679a1dc9c0336c622..2f00cfea9039892eacaa6e0a4e2f5c133c66aa9a 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 .= '
' . t('Setting permissions') . '
'; $output .= '
' . t('After creating roles, you can set permissions for each role on the Permissions page. 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'))) . '
'; $output .= '
' . t('Managing account settings') . '
'; - $output .= '
' . t('The Account settings page 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'))) . '
'; + $output .= '
' . t('The Account settings page 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'))) . '
'; $output .= '
' . t('Managing user account fields') . '
'; $output .= '
' . t('Because User accounts are an entity type, you can extend them by adding fields through the Manage fields tab on the Account settings page. 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 Field module help page.', array('!field_help'=>\Drupal::url('help.page', array('name' => 'field')), '!accounts' => \Drupal::url('entity.user.admin_form'))) . '
'; $output .= ''; @@ -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 4c9c786c2f4f830daff17c645194bbba604d672b..eebd4edad5a502291bd00c0ed81d6ed2368644c9 100644 --- a/core/modules/views_ui/src/Tests/HandlerTest.php +++ b/core/modules/views_ui/src/Tests/HandlerTest.php @@ -123,8 +123,8 @@ public function testUICRUD() { $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 1d6718d4f7bd1b70f593987b9ce311eec0fdb88c..21cca3c0ecc561c81ff9626d624150d706a22723 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') }}