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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Perhaps until that core issue gets fixed we should roll back the change from vid to machine name?

Dave Reid’s picture

We 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().

Dave Reid’s picture

Status: Active » Needs review
FileSize
8.11 KB

Attached 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.

Dave Reid’s picture

And second time, fixing the one test failure to account for latest Token module element validation.

Dave Reid’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Patch (to be ported)
Dave Reid’s picture

6.x-2.x and 6.x-1.x will still need to handle checking if node types are changed.

Dave Reid’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Dave Reid’s picture

Status: Patch (to be ported) » Fixed
Dave Reid’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Status: Fixed » Closed (fixed)

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