summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries2012-05-15 02:11:31 (GMT)
committerDries2012-05-15 02:11:31 (GMT)
commitf9e44fc40a4d3323d005e74846773e96a8d79abf (patch)
tree4ebe1b4b5d897598e08ed78e8a18e6920449fd0b
parentb551b666deb2b54fea1ce171ef99cecd3518696e (diff)
- Patch #967566 by mariusz.slonina, rbayliss, joestewart, xjm, tim.plunkett, indytechcook, tsvenson, adnasa, oriol_e9g | DocuAnt: Several important Core User settings lack support for hook_field_extra_fields().
-rw-r--r--core/modules/block/block.module13
-rw-r--r--core/modules/block/block.test28
2 files changed, 41 insertions, 0 deletions
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index f7d8dc0..97f59e9 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -626,6 +626,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().
*/
function block_user_presave($account) {
diff --git a/core/modules/block/block.test b/core/modules/block/block.test
index 7782e77..e6b2e42 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.
*/