When cloning a node, the cloned node is presented on a form that has apparently not been run through drupal_prepare_form() and so any form alters for that node type are not present in the resulting page until after submitting and re-editing the node.

Comments

pwolanin’s picture

hmm, that's not good - but why is that happening if I call it as:

      return  drupal_get_form($node->type .'_node_form', $node);

drupal_get_form should always run the alter hook, right?

pwolanin’s picture

Status: Active » Postponed (maintainer needs more info)

note - this is exactly the same code used here : http://api.drupal.org/api/function/node_page_edit/5

Perhaps there is something else funny with your code - like incorrect assumptions about the path that arg(2) == 'edit'? Where are you seeing this problem?

harry slaughter’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

You are correct. I was checking arg() values as well, not sure why.

hook_form_alter runs fine.