maintenance for url_alias_extra
greggles - November 20, 2007 - 13:12
| Project: | Pathauto |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
1) In hook_cron delete pids that no longer exist in the url_alias table
2) in hook_uninstall drop the tables
3) modify the "delete pathauto aliases" query so that it only does this for
4) in hook cron divine information about aliases that are not currently in url_alias_extra (e.g. entity_type and entity_id) and assume that they were admin created
Anything else?

#1
Here is a patch that does items 1-3.
Item 4 still needs help but that is lower priority to me.
#2
We actually should do #4 and it should be in an _update or _install function instead of _cron. This way we add entries in url_alias_extra for all node/user/taxonomy aliases and mark them as being from Pathauto. If that's not the case, admins can manually remove them. But at least we have a baseline and then http://drupal.org/node/201659 will work properly.
#3
If I understand #4 correctly, this is what it should do:
Please clarify if necessary.
#4
Mostly right - the only point where I disagree is debatable. We want the assumption (between "admin" and "pathauto") to be that most common case. I believe that in most cases the majority of aliases on a site are created by Pathauto. So, I think we should mark them all as pathauto created.
I created a discussion point for it http://groups.drupal.org/node/7753 - and got basically no response. NikLP and I discussed it in IRC and he agreed (though his response isn't 100% accurate). I've updated the group with a poll - http://groups.drupal.org/node/8329 - maybe that will get more responses.
Fortunately, that part is easy to change. The hard part (in my opinion) will be queries that work across databases that will parse apart the src to get the object type and object ID. Also, we need to modify the url_alias_extra table to include an extra column for things like "user" "1" "track" or whatever.
#5
I actually agree with you on that :) What I said there, I extracted from your initial post:
However, your last paragraph got me confused. What do you mean by "across databases"? You mean across tables? And URL aliases for user/uid/track aren't generated automatically. They are for user/uid, which we should be able to use wildcard queries for (node/%) and then only keep the valid ones. This same system can be applied for node/nid and taxonomy/term/tid.
Am I oversimplifying things?
#6
"across databases" i.e. on both mysql and pgsql.
And I think we actually do need to care about 'user/%/track' since we have the tracker_pathauto integration.
#7
Oh. Sigh. I'll try to stick with MySQL, then.
And I didn't know about the tracker_pathauto feature. That will indeed require an extra column.
#8
#9
see http://drupal.org/node/180440#comment-728092
#10
Since there is no "url_alias_extra" at the moment, shouldn't this one be closed or "by-design"'ed or "won't-fix"'ed or something? If a new "url_alias_extra" sees the light of day, we can either make sure it's maintained properly from the start... or make a new issue.
#11
Seems reasonable to me.