I know this is a known problem, but I couldn't see an existing issue for it. Right now View Alias does not update or delete terms if they are changed through the UI. This patch abstracts the alias creation procedure so that it can be used in hook_pathauto_bulkupdate() and in hook_taxonomy().
This abstracted function also makes some other changes. Instead of using a custom implementation to generate paths, it instead passes the pattern and tokens to pathauto and lets it handle it. This has the advantage that it automatically supports all of Pathauto's settings including:
- Verbosity (controls drupal_set_message() notices)
- Case sensitivity
- Handling of deleting old aliases on update, or following Pathauto's setting for when updating an alias
Plus the total amount of code seems to remain about the same and our aliases will match others created by Pathautho.
Comment | File | Size | Author |
---|---|---|---|
#5 | view-alias-term-update-multi-vocab.patch | 9.09 KB | sheena_d |
#4 | view-alias-term-update-multi-vocab.patch | 9.09 KB | sheena_d |
view_alias_update.patch | 2.72 KB | quicksketch |
Comments
Comment #1
emackn CreditAttribution: emackn commentedRolling into head now.
What are the steps again to reproduce the error?
Comment #2
emackn CreditAttribution: emackn commentedHmm... After applying this, I can't get the aliases to generate.
I removed all aliases, and still can't generate them.
Comment #3
Andrew Gorokhovets CreditAttribution: Andrew Gorokhovets commented+1
Comment #4
sheena_d CreditAttribution: sheena_d commentedI created a new patch based on quicksketch's original patch that applies to the current dev branch. As far as my testing, this patch will successfully create/update/delete aliases during the appropriate actions on taxonomy terms. It also works correctly for views with multiple vocabularies available to the argument.
Comment #5
sheena_d CreditAttribution: sheena_d commentedMade a mistake in the previous patch that caused an alias to be created for every term used in any views that used aliases. The attached patch works correctly.
Comment #6
John Franklin CreditAttribution: John Franklin commentedThere is way too much in that patch out of scope.