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

greggles - December 18, 2007 - 13:38
Status:active» patch (code needs review)

Here is a patch that does items 1-3.

Item 4 still needs help but that is lower priority to me.

AttachmentSize
maintenance_for_url_alias_extra_193825.patch3.17 KB

#2

greggles - December 18, 2007 - 21:38
Status:patch (code needs review)» patch (code needs work)

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

Wim Leers - January 20, 2008 - 21:31

If I understand #4 correctly, this is what it should do:

  1. get everything from the url_alias table that's not yet in the url_alias_extra table, but only if it's one of the entities pathauto supports by default (node/taxonomy/user)
  2. insert corresponding entries for these into url_alias_extra and mark them as admin created

Please clarify if necessary.

#4

greggles - January 20, 2008 - 22:51

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

Wim Leers - January 20, 2008 - 23:01

I actually agree with you on that :) What I said there, I extracted from your initial post:

and assume that they were admin created

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

greggles - January 20, 2008 - 23:21

"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

Wim Leers - January 21, 2008 - 00:35

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

greggles - January 21, 2008 - 13:26
Assigned to:greggles» Anonymous

#9

greggles - February 13, 2008 - 12:28
Status:patch (code needs work)» postponed

see http://drupal.org/node/180440#comment-728092

#10

Freso - October 1, 2008 - 05:40

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

greggles - October 1, 2008 - 14:50
Status:postponed» closed

Seems reasonable to me.

 
 

Drupal is a registered trademark of Dries Buytaert.