I just deleted the following from the flag_friend_access.module and wanted to verify that this was ok to do, and won't cause any problems with my website?

Thanks,

Joe

/**
* Implementation of hook_form_alter().
*/
function flag_friend_access_form_alter(&$form, &$form_state, $form_id) {
// add in a checkbox only if the
if ($form['#node']->type . '_node_form' == $form_id && empty($form['#node']->nid)) {
// we have a node form alter in our stuff
$form['flag_friend_control'] = array(
'#type' => 'fieldset',
'#title' => t('Viewable to All, or:'),
'#collapsable' => FALSE,
);
$form['flag_friend_control']['flag_friend_access'] = array(
'#type' => 'checkbox',
'#title' => t('Only My Friends'),
);
}
}

Comments

Scott Reynolds’s picture

Why would you delete that? The easiest way to remove the flag_friend_access check box is this

function my_module_form_alter(&$form, $form_state) {
  $form['#pre_render'][] = 'my_module_remove_flag_friend_access';
}

function my_module_remove_flag_friend_access($form) {
  if (isset($form['flag_friend_control'])) {
    $form['flag_friend_control']['#access'] = FALSE;
  }
  return $form;
}

This then allows you to seamlessly update the flag friend module with out having to maintian a hack up version of it.

sirkitree’s picture

Status: Active » Closed (fixed)