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 5 : Redirect after node creation

  • Initialization part
    • hook_menu
  • Load part
    • hook_load(valid nid)
    • hook_nodeapi('load', valid nid)
  • View part
    • hook_view(valid nid)
    • hook_user('load', valid uid)
    • hook_nodeapi('view')
    • (hook_link) and others can appear if hook_view invokes l()
  • Rest of page
    • hook_node_types
    • hook_block. As many times as there are blocks to be displayed by this module.
    • hook_help(section = node/<nid>)

Step 6 : Editing the new node

  • Initialization part:
    • hook_menu
  • Load part:
    • hook_load(valid nid)
    • hook_nodeapi('load', valid nid)
  • Mystery part
    • hook_user('load', no uid, valid name)
  • Validation part:
    • hook_validate. Node contains loaded object if applicable.
    • hook_nodeapi('validate', valid nid)
  • Form part:
    • hook_nodeapi('form pre', valid nid)
    • hook_form. Node contains loaded object if applicable.
    • hook_nodeapi('form post', valid nid)
    • hook_nodeapi('form admin', valid nid)
    • hook_nodeapi('form param', valid nid)
  • Rest of page
    • hook_node_types
    • hook_block. As many times as there are blocks to be displayed by this module.
    • hook_help(section = node/<nid>/edit)
dr/api_sequences.1129490682.txt.gz · Last modified: 2020/11/23 17:23 (external edit)