Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Ugh, if I change a node type or vocabulary machine name, the pathauto variables are not renamed, and will result in a loss of functionality. We're also blocked by another core issue: #876762: Modules have no way of knowing if vocabulary machine names are changed.
Comment | File | Size | Author |
---|---|---|---|
#4 | 876768-pathauto-handle-bundle-rename-delete.patch | 9.68 KB | Dave Reid |
#3 | 876768-pathauto-handle-bundle-rename-delete.patch | 8.11 KB | Dave Reid |
Comments
Comment #1
gregglesPerhaps until that core issue gets fixed we should roll back the change from vid to machine name?
Comment #2
Dave ReidWe could but we would still have to address the issue of node type machine names being changed. Plus, the issue linked above is already RTBC. It's also an easy work-around by implementing a hook_taxonomy_vocabulary_presave().
Comment #3
Dave ReidAttached patch for review that:
1. Implements hook_field_attach_rename_bundle() to account for when entity bundles have their machine name changed.
2. Implements hook_field_attach_delete_bundle() to account for when entity bundles are removed and Pathauto should cleanup its variables.
3. Adds tests to ensure #1 and #2 work as desired.
4. Renames the variables 'pathauto_taxonomy_*' to 'pathauto_taxonomy_term_*' to match the 'taxonomy_term' entity type.
Comment #4
Dave ReidAnd second time, fixing the one test failure to account for latest Token module element validation.
Comment #5
Dave ReidCommitted #4 to CVS
http://drupal.org/cvs?commit=467242
Comment #6
Dave Reid6.x-2.x and 6.x-1.x will still need to handle checking if node types are changed.
Comment #7
Dave ReidCommitted to 6.x-2.x: http://drupalcode.org/project/pathauto.git/commit/c3032d9
Comment #8
Dave ReidCommitted to 6.x-1.x: http://drupalcode.org/project/pathauto.git/commit/f19d683
Comment #9
Dave Reid