fapi form alter

decibel.places's picture

Fix for hook_form_alter returns WSOD - remove brackets around new element array members and add $form_state to function

  1. /* Implements hook_form_alter */
  2.  
  3. function back_button_form_alter (&$form, $form_state, $form_id){
  4. if ($form_id == 'video_node_form'){
  5.   $form['back']= array(
  6.         '#type' => 'submit',
  7.         '#value' =>
decibel.places's picture

hook_form_alter returns WSOD when $form_id is checked, $form_id is returned as an array,works on all forms without $form_id test

  1. /* Implements hook_form_alter */
  2.  
  3. function back_button_form_alter (&$form, $form_id){
  4. if ($form_id == 'video_node_form'){
  5.   $form['back']= array(
  6.         ['#type'] => 'submit',
  7.         ['#value'] => t('Make C

how to name fapi calls

  1. // generic function
  2. function mymod_form_alter(&$form, $form_state, $form_id) {
  3.         //dpm($form); -- I frequently use this devel call to check things out as needed
Syndicate content