Remove notices from user profile edit form

Remove undefined index notices from user profile edit form,
caused by groups_comment_text_format_alter() inproper variable
check.

Change-Id: I168a2dd119b403be601b2ec186a06cced81aacaa
This commit is contained in:
Marton Kiss 2015-03-10 11:47:21 +01:00
parent ac095fb078
commit 7f16d61e2f
2 changed files with 14 additions and 10 deletions

View File

@ -36,10 +36,12 @@ function groups_comment_form_comment_form_alter(&$form, &$form_state) {
* Set default text format to markdown for the group/body field.
*/
function groups_comment_text_format_alter(&$element) {
if (($element['#bundle'] == 'comment_node_post') && ($element['#field_name'] == 'comment_body')) {
// set default value to markdown
$element['format']['format']['#default_value'] = 'markdown';
// hide text format filter
$element['format']['#access'] = FALSE;
if ((isset($element['#bundle'])) && (isset($element['#field_name']))) {
if (($element['#bundle'] == 'comment_node_post') && ($element['#field_name'] == 'comment_body')) {
// set default value to markdown
$element['format']['format']['#default_value'] = 'markdown';
// hide text format filter
$element['format']['#access'] = FALSE;
}
}
}

View File

@ -143,11 +143,13 @@ function groups_groups_theme() {
*/
function groups_groups_text_format_alter(&$element) {
$bundles = array('group', 'post');
if ((in_array($element['#bundle'], $bundles)) && ($element['#field_name'] == 'body')) {
// set default value to markdown
$element['format']['format']['#default_value'] = 'markdown';
// hide text format filter
$element['format']['#access'] = FALSE;
if ((isset($element['#bundle'])) && (isset($element['#field_name']))) {
if ((in_array($element['#bundle'], $bundles)) && ($element['#field_name'] == 'body')) {
// set default value to markdown
$element['format']['format']['#default_value'] = 'markdown';
// hide text format filter
$element['format']['#access'] = FALSE;
}
}
}