Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have 2 modules. Let's call them Publisher and Publication for discussion's sake.

Publication module requires Publisher module. Publisher module provides form to edit publisher's data. Publication module provides list of publications with reordering and adding capability, and it can be limited to display only publications by one publisher.

Now, I want to nest publisher's publications form at the bottom of his data edit form. I would prefer to avoid writing same code again - I want to keep validation functions and submit functions as they are now, just have it on one screen, with one submit button.

Subform seems to be unmaintained and buggy at this point and Multiple forms seems to skip validations altogether, that makes both of them unusable for me.

share|improve this question
1  
Look what i found drupal.org/project/subform –  Nikhil M Jun 6 '13 at 9:28
 
@NikhilM Oldest open bug is 1 year 51 weeks old and at least 2 of 5 open bugs would interfere with my forms in a way it would probably render it unusable. Otherwise, good call. –  Mołot Jun 6 '13 at 9:31
add comment

1 Answer

You can use the admin/content page as a reference to combine forms. There, the filter form and overview form are passed as elements in a new $form array.
Coming from the content administration callback function in the node.admin.inc file:


/**
 * Menu callback: content administration.
 */
function node_admin_content($form, $form_state) {

  $form['filter'] = node_filter_form();
  $form['#submit'][] = 'node_filter_form_submit';
  $form['admin'] = node_admin_nodes();

  return $form;
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.