http://api.drupal.org/api/drupal/modules--node--node.pages.inc/function/... is a submission handler for the 'Delete' button on a node edit form. All it does is redirect the user to a specific path, where the node delete confirmation form is available.

The patch at #1199428: Incremental UX improvements to Field UI adds an almost identical submission handler to the Field admin form.

Taxonomy term admin forms would ideally need a similar pattern (see http://drupal.org/node/949616#comment-4199948 for more about the mess in term edit forms at the moment).

So it seems that we're going to be peppering core with almost identical form submission handlers, that merely move the user to another form. Perhaps FormAPI could provide a helper function here?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Needs review
FileSize
2.33 KB

Here's a patch.

Start your bikesheds on the function name, please!

andypost’s picture

Maybe just extent #redirect key for submit element to make no function at all? And make FormAPI process #redirect key properly

joachim’s picture

I like the idea of putting #redirect deeper in FormAPI, but for this sort of use you'd still need to specify a #submit for the Delete button to avoid going to the regular submit function.

brianV’s picture

Version: 8.x-dev » 7.x-dev

Bumping down to D7 as node_form(), node_form_delete_submit() etc. no longer exist in D8.