- 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().

8.0.x
Dries 2012-05-14 22:11:31 -04:00
parent b551b666de
commit f9e44fc40a
2 changed files with 41 additions and 0 deletions

View File

@ -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().
*/

View File

@ -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.
*/