diff --git a/core/modules/block/block.module b/core/modules/block/block.module index f7d8dc0c5b44932b0eb6635da1ea3eef216fea8b..97f59e9e6095a2819757764bf9529a2357c8a2fd 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -625,6 +625,19 @@ function block_form_user_profile_form_alter(&$form, &$form_state) { } } +/** + * Implements hook_field_extra_fields(). + */ +function block_field_extra_fields() { + $extra['user']['user']['form']['block'] = array( + 'label' => t('Personalize blocks'), + 'description' => t('Block module form element.'), + 'weight' => 3, + ); + + return $extra; +} + /** * Implements hook_user_presave(). */ diff --git a/core/modules/block/block.test b/core/modules/block/block.test index 7782e77d5be258c1b8bde4d3975c68f72c4f049b..e6b2e42f38173c3c6d7da731d50b3b0fba6f6854 100644 --- a/core/modules/block/block.test +++ b/core/modules/block/block.test @@ -848,6 +848,34 @@ class BlockHiddenRegionTestCase extends WebTestBase { } } + +/** + * Tests personalized block settings for user accounts. + */ +class BlockUserAccountSettingsTestCase extends WebTestBase { + public static function getInfo() { + return array( + 'name' => 'Personalized block settings', + 'description' => 'Tests the block settings in user accounts.', + 'group' => 'Block', + ); + } + + public function setUp() { + parent::setUp(array('block', 'field_ui')); + $admin_user = $this->drupalCreateUser(array('administer users')); + $this->drupalLogin($admin_user); + } + + /** + * Tests that the personalized block is shown. + */ + function testAccountSettingsPage() { + $this->drupalGet('admin/config/people/accounts/fields'); + $this->assertText(t('Personalize blocks'), 'Personalized block is present.'); + } +} + /** * Functional tests for the language list configuration forms. */