In pathauto_field_attach_form() you just check whether $form['path'] exists and, if it does, add your code accordingly.
However other entity types might use the "path" form element completely differently, and the code in this hook implementation then completely breaks the form. Please change this in some way so it's safer for modules who don't have anything to do with Pathauto.

Comments

kristiaanvandeneynde’s picture

Issue summary: View changes

Necromancing this issue with a +1, simply altering any form which so happens to have a 'path' element is a big no-no :-( There should be another way to attach the form elements.

One way of doing it would be a boolean 'pathauto support' key in hook_entity_info() which you then polyfill for node, user and taxonomy. You should also document that having this set to TRUE expects a vertical 'additional_settings' tab and a 'path' element in said tabs.

drunken monkey’s picture

Issue summary: View changes

(Fixing embarrassing typos in OP.)

Dave Reid’s picture