Limiting validation to the create page not the edit page
What is the best way to limit your custom validation check to the add page an开发者_C百科d not the edit page?
You could use the arg() function to check that you're on the /node/add/... page. Try changing the first line inside your hook_form_alter implementation to read...
if($form_id === 'external_favourite_node_form' && arg(1) == 'add') {
精彩评论