why does this:

node/add/content_my_type

have the same $form_id as:

admin/node/types/content_product/fields

i am sure there is some logic to it.. but it is certainly a pain in the ass.

Comments

liquidcms’s picture

ooops.. typos

should have read:

why does this:

node/add/content_my_type

have the same $form_id as:

admin/node/types/content_my_type/fields

yched’s picture

They don't.
It's just that during the process of building the fields overview form (id = 'content_admin_field_overview_form'), a "fake" node edit form (id = 'type1_m_node_form') is generated internally, and then parsed to populate the overview with the relevant lines.

Could you be more specific on the nuisance, if any ?

liquidcms’s picture

i have a type called content_product

i do form_alter when adding a node of this type but the code is trying to run on the manage fields page as well since it seems they both have same form_id.. work around is easy; just thought it was odd they would have same id..

i do this in my module:

function example_form_alter (....) {
switch ($form_id) { 

        case 'content_product_node_form':
            if (arg(0) == 'admin') break;   // need to add this to skip admin pages like manage fields
            
           [ do the code here that i want for form_alter when adding node ]
        break;
}
}
  
yched’s picture

Status: Active » Closed (duplicate)

Re-read my post.

Marking this a dupe of http://drupal.org/node/121385