diff --git a/core/modules/contact/config/schema/contact.schema.yml b/core/modules/contact/config/schema/contact.schema.yml index e8df71a..4a85fc0 100644 --- a/core/modules/contact/config/schema/contact.schema.yml +++ b/core/modules/contact/config/schema/contact.schema.yml @@ -43,6 +43,9 @@ contact.settings: user_default_enabled: type: boolean label: 'Personal contact form enabled by default' + contact_default_scope: + type: integer + label: 'Personal contact form enabled by default for existing users' migrate.source.d6_contact_settings: type: migrate_source_sql diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php index 031ee75..8426b4a 100644 --- a/core/modules/contact/src/Tests/ContactPersonalTest.php +++ b/core/modules/contact/src/Tests/ContactPersonalTest.php @@ -221,6 +221,16 @@ function testPersonalContactAccess() { $this->drupalGet('user/' . $this->contactUser->id() . '/contact'); $this->assertResponse(200); + + // Test "Enable by default" for existing users. + $this->moduleInstaller()->uninstall(['contact']); + $this->contactUserPreEnable = $this->drupalCreateUser(); + $this->moduleInstaller()->install(['contact']); + $edit = ['contact_default_status' => FALSE, 'contact_default_scope' => 1]; + $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration')); + $this->drupalGet('user/' . $this->contactUserPreEnable->id() . '/contact'); + $this->assertResponse(200); + } /**