summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-08-29 06:08:03 (GMT)
committerwebchick2014-08-29 06:08:03 (GMT)
commitaca1ec38ebfb38ddf2272bcedd964be00b8fe0ae (patch)
treedd905f5eb8ebf7c9d02629f5d597ea97c5774b73
parent3b8307bccd246411aefc5cf0b408c97b8031dfbf (diff)
Issue #2321621 by swentel: Fixed Use signatures checkbox on User config page doesn't appear.
-rw-r--r--core/modules/user/src/AccountSettingsForm.php3
-rw-r--r--core/modules/user/src/Tests/UserSignatureTest.php13
2 files changed, 14 insertions, 2 deletions
diff --git a/core/modules/user/src/AccountSettingsForm.php b/core/modules/user/src/AccountSettingsForm.php
index 8fc998b..d164f6e 100644
--- a/core/modules/user/src/AccountSettingsForm.php
+++ b/core/modules/user/src/AccountSettingsForm.php
@@ -445,6 +445,9 @@ class AccountSettingsForm extends ConfigFormBase {
$this->config('system.site')
->set('mail_notification', $form_state->getValue('mail_notification_address'))
->save();
+
+ // Clear field definition cache for signatures.
+ \Drupal::entityManager()->clearCachedFieldDefinitions();
}
}
diff --git a/core/modules/user/src/Tests/UserSignatureTest.php b/core/modules/user/src/Tests/UserSignatureTest.php
index 6c86eb2..1eb9af7 100644
--- a/core/modules/user/src/Tests/UserSignatureTest.php
+++ b/core/modules/user/src/Tests/UserSignatureTest.php
@@ -21,7 +21,7 @@ class UserSignatureTest extends WebTestBase {
*
* @var array
*/
- public static $modules = array('node', 'comment');
+ public static $modules = array('node', 'comment', 'field_ui');
protected function setUp() {
parent::setUp();
@@ -62,7 +62,7 @@ class UserSignatureTest extends WebTestBase {
// Create regular and administrative users.
$this->web_user = $this->drupalCreateUser(array('post comments'));
- $admin_permissions = array('post comments', 'administer 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;
@@ -129,5 +129,14 @@ class UserSignatureTest extends WebTestBase {
// Verify that the user signature's text format's cache tag is present.
$this->drupalGet('node/' . $node->id());
$this->assertTrue(in_array('filter_format:filtered_html_format', explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'))));
+
+ // Verify the signature field is available on Manage form display page.
+ \Drupal::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');
}
}