Alter field collection edit form in hook_menu_alter I need to create my own form and validation (when field collection entity is Edited).

function common_menu_alter(&amp;$items) {
    //alter add(insert) - working
    $items['field-collection/field-block-id/add/%/%']['page callback'] = '_common_field_collection_item_add';
    //alter edit - not working
    $items['field-collection/field-block-id/%field_collection_item/edit ']['page arguments'] = '_common_field_collection_item_form'
}


_common_field_collection_item_add() is my own function in my common.module.

I managed to alter the entity on insert, but changing the "edit" part doesn't work. This is the path of my field collection edit: field-collection/field-block-id/%/edit?destination=node/%.
I tried to put this path to $items, but it still doesn't not work.

In hook_form_alter() I did this.

if ($form_id == 'field_collection_item_form' &amp;&amp; arg(3) == 'edit') {
       $form['#validate'][] = '_common_field_collection_item_form_validate';
       $form['#submit'][] = '_common_field_collection_item_form_submit';
}
Better to use the Field Attach API hooks instead.

e.g:


hook_field_attach_form
hook_field_attach_validate