Closed (fixed)
Project:
Pathauto
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 Jan 2008 at 22:15 UTC
Updated:
5 Feb 2008 at 14:31 UTC
Jump to comment: Most recent file
The list of alias types that generate the list are currently hard coded in _pathauto_objects_to_delete(). This is bad if some module implements pathauto for pages that don't fit any of those "objects". A simple hook to build the array of objects should be a simple fix. (Yes, I'm volunteering. :) )
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | pathauto_bulk_delete.patch | 3.26 KB | Island Usurper |
| #4 | pathauto_bulk_delete.module.patch | 3.2 KB | Island Usurper |
| #2 | pathauto_bulk_delete.module.patch | 985 bytes | Island Usurper |
Comments
Comment #1
gregglesGreat! Go for it!
Comment #2
Island Usurper commentedHopefully I got the right version to roll the patch against. It creates a hook called hook_pathauto_objects() which should return an array similar to _pathauto_objects_to_delete().
Comment #3
gregglesThis is great.
I think the hook should be hook_path_objects_to_delete or something similar. Just "pathauto_objects" doesn't make it clear what is happening. Also, perhaps some day this "bulk delete" belongs somewhere else at which point having the word pathauto in the hook won't be so good.
Can you add documentation for this to the API.txt file?
What do you think about making the array that you assigned to $objects into an implementation of this hook?
Using your hook name:
Thanks very much!
Comment #4
Island Usurper commentedIt's possible that this hook could be used for other reasons, so I named it hook_path_alias_type(). I don't believe anything like that is used in Path or Pathauto yet.
The patch also includes changes to API.txt.
Comment #5
gregglesVery cool.
Two more things then it looks good.
In API.txt you say for localization use % but it's not for localization, it's for a wildcard in the DB lookup.
And part of being really specific about what the % does is also in the naming of the hook. If it's just a list of objects then people are unlikely to get the alias part right. If the hook has the word "delete" in the name then people know "oh, when I implement this I better do it right so people don't accidentally delete something"
I purposefully leave it as review because I'd be ok with being overridden on these.
What do you think?
Comment #6
Island Usurper commentedI didn't mean to connect the idea of localization with the % wildcard. I was referring to the path descriptions. But if I was that unclear, it needs adjusting.
Comment #7
gregglesGreat - and thoughts on the hook name as "path_alias_types" vs. "path_alias_types_to_delete" ?
Comment #8
Island Usurper commentedWhile it may never happen, this hook could be invoked at other times than just deleting the aliases. The hook itself doesn't have anything to do with deleting, it's just the only context it happens to be in.
Comment #9
gregglesVisually this made sense to me, but I wanted to at least give it a quick test. Quick test done - works great.
Thanks Island Usurper! Committed to the DRUPAL-5--2 branch and HEAD.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.