The code inside pathauto_form_alter() for adding all its fields to the node's path fieldset should be abstracted to work for any entity. That way we can re-use it on taxonomy term forms.

Comments

dave reid’s picture

Status: Active » Needs work
StatusFileSize
new6.84 KB

Here's how it would look in patch and the simplified way to add the 'Automatic URL alias' settings to an individual entity's form.

function pathauto_form_alter(&$form, &$form_state, $form_id) {
  // Process only node forms.
  if (!empty($form['#node_edit_form'])) {
    $node = $form['#node'];
    pathauto_entity_path_edit_form($form['path'], 'node', $node);
  }
}
dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new7.47 KB

New patch using pathauto_field_attach_form() but calling it from form_alters since hook_field_attach_form() runs before any path module alters.

dave reid’s picture

StatusFileSize
new7.48 KB
dave reid’s picture

Title: Make a pathauto_entity_alias_edit_form for re-use » Allow the Pathauto form altering to be re-usable
StatusFileSize
new14.76 KB

With tests.

dave reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.