User Tools

Site Tools


dr:api_sequences

This is an old revision of the document!


API Sequences: 6 steps to creating a node

(in Drupal 4.6.x)

Step 1: Clicking on node type in "Create content"

  • Initialization part
    • hook_menu
    • hook_node_types
    • hook_user('load'). uid not defined at this point, name defined.
  • NO LOAD PART
  • node_validate
    • hook_validate. Builtin fields initialized
    • hook_nodeapi('validate')
  • Form part
    • hook_nodeapi('form pre')
    • hook_form. Builtin fields initialized.
    • hook_nodeapi('form post')
    • hook_nodeapi('form param')
  • Rest of page
    • hook_name
    • hook_node_types. Again.
    • hook_block. As many times as there are blocks to be displayed by this module.
    • hook_help(section = node/add/<node type>)

Step 2 : Clicking on PREVIEW for a new node

  • hook_form. Node contains form fields, mixing builtin fields and module from object. No object.
  • Initialization part
    • hook_menu
    • hook_user('load'). uid not defined at this point, name defined.
  • NO LOAD PART
  • node_validate
    • hook_validate. Node contains form fields, mixing builtin fields and module from object. No object.
    • hook_nodeapi('validate')
  • Preview part
    • hook_user('load'). uid not defined at this point, name defined. Again.
    • hook_view(). Node contains form fields, mixing builtin fields and module from object. No object.
  • Form part
    • hook_nodeapi('form pre')
    • hook_form. Builtin fields initialized.
    • hook_nodeapi('form post')
    • hook_nodeapi('form param')
  • Rest of page
    • hook_name
    • hook_block. As many times as there are blocks to be displayed by this module.
    • hook_help(section = node/add/<node type>)

Step 3: Clicking on SUBMIT for an invalid node

  • hook_validate
  • hook_view. Node contains loaded object if applicable
  • hook_nodeapi('view')

Step 4 : Clicking on SUBMIT for a valid node

  • Initialization part
    • hook_menu
    • hook_user('load'). uid not defined at this point, name defined.
  • NO LOAD PART
  • node_validate
    • hook_validate. Node contains form fields, mixing builtin fields and module from object. No object.
    • hook_nodeapi('validate')
  • Insert part
    • hook_nodeapi('fields')
    • hook_insert. Node contains form fields, mixing builtin fields and module from object. No object.
    • hook_nodeapi('insert')
  • Rest of page
    • hook_name
    • hook_node_types
    • hook_block. As many times as there are blocks to be displayed by this module.
    • hook_help(section = node/add/<node type>)

Step 6 : Editing the new node

  • Loading part:
    • hook_load
    • hook_nodeapi('load')
  • Validation part:
    • hook_validate
    • hook_nodeapi('validate')
  • Form part:
    • hook_nodeapi('form pre')
    • hook_form. Node contains loaded object if applicable.
    • hook_nodeapi('form post')
    • hook_nodeapi('form admin')
    • hook_nodeapi('form param')
dr/api_sequences.1129489662.txt.gz · Last modified: 2020/11/23 17:23 (external edit)