NOTE: See comments #3/4 for the actual bug report here...

--- original report ---

I can't find documentation for form_node although it is used for adding configuration fields to nodes. It is used especially in hook_form_node_form_alter, see :
http://api.drupal.org/api/search/7/form_node
So is form_node or hook_form_node_form_alter documentation needs to be written ? Where is it ?

I searched the doc :
http://api.drupal.org/api/search/7/hook_form_node_form_alter

I also found a single implementation of hook_form_node_form_alter in the node module.

CommentFileSizeAuthor
#5 drupal-small_doc_header_fix_1415794-4.patch551 bytesb2f
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

b2f’s picture

Project: Documentation » Drupal core
Issue summary: View changes

small update

b2f’s picture

Project: Drupal core » Documentation

Actually, I found the functionality I was looking for with hook_field_attach_form. Maybe this issue is not relevant because hook_form_node_form_alter is obsolete.

jhodgdon’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Missing documentation » documentation
Category: feature » bug
Status: Active » Closed (works as designed)

There is documentation for hook_form_FORM_alter(). That is probably/possibly what you were looking for?

Also, issues about documentation on api.drupal.org belong in the Drupal Core project issue queue.

b2f’s picture

I am a bit confused, I came across "i18n_node_form_node_form_alter" so I thought it was about hook_form_alter but in fact it's hook_form_BASE_FORM_ID_alter... Anyway, look inside node/tests/node_access_test.module line 162 you will find :

/**
 * Implements hook_form_node_form_alter().
 */
function node_access_test_form_node_form_alter(&$form, $form_state) {
  // Only show this checkbox for NodeAccessBaseTableTestCase.
  if (variable_get('node_access_test_private')) {
    $form['private'] = array(
      '#type' => 'checkbox',
      '#title' => t('Private'),
      '#description' => t('Check here if this content should be set private and only shown to privileged users.'),
      '#default_value' => isset($form['#node']->private) ? $form['#node']->private : FALSE,
    );
  }
}

It's not a problem for me, but is this lacking documentation ?

jhodgdon’s picture

Title: hook_form_node_form_alter ? » node_access_test_form_node_form_alter() has wrong documentation header
Version: 7.x-dev » 8.x-dev
Status: Closed (works as designed) » Active
Issue tags: +Novice

Thanks! That documentation is wrong. I am opening this issue back up so that it can get fixed.

http://api.drupal.org/api/drupal/core--modules--node--tests--node_access...

The problem is that it references hook_form_node_form_alter(), which does not exist. It should reference hook_form_BASE_FORM_ID_alter() instead.

Good novice project...

jhodgdon’s picture

Issue summary: View changes

small update

b2f’s picture

Assigned: Unassigned » b2f
FileSize
551 bytes

I made my first git patch, attached here. I followed these guidelines : http://drupal.org/node/1054616.
Is it correct ?

jhodgdon’s picture

Status: Active » Reviewed & tested by the community
Issue tags: +Needs backport to D7

Looks good to me, thanks!

For future reference, when you upload a patch, set the status to "needs review", so the test bot can test it. You might also be interested in reading this section of documentation:
http://drupal.org/novice

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

reference actual problem