how many of your aliases are manually created?

greggles's picture
public
group: Paths
greggles - Tue, 2007-12-18 19:01

In Pathauto 5.x-2.0 you now have the option (if you have the permission to create aliases) to tell Pathauto not to do its job and instead to let you set the path alias.

There is a new feature in the 2.x development branch of Pathauto which keeps track of whether the admin created the alias or not. If it appears to Pathauto that the admin created the alias, then Pathauto will not try to alias the object in the future.

So,

  • create (or edit) a node and uncheck the box for "Automatic alias"
  • edit the node again and submit - pathauto will remember your setting from last time and not create an alias for this node
  • as a user who does not have permission to create alias, edit the node and submit, Pathauto checks and remembers the setting from step 1 and not create an alias for the node

I think this is the desired behavior, but it has a drawback: we don't know the setting from step 1 for all aliases created before 5.x-2.1 so Pathauto assumes it should not create aliases whenever aliases from before 5.x-2.1 were created.

Proposal During the upgrade process Pathauto could run a query that would just create records for all old aliases and say "we assume that all nodes, users, and taxonomy objects were aliased by Pathauto" and therefore update them in the future normally. We can further instruct users in how to edit the table to mark them as admin maintained if the admin wants to prevent Pathauto form overwriting their work.

Benefits of this new database table include faster bulk deletes, more granular bulk deletes (i.e. just aliases created by pathauto), and eventually that it can be migrated to the core url_alias table and we won't have this problem :)

I'm inclined to follow my proposal since this is basically what we have already, but I'm posting here to get feedback to see if anyone feels that is wrong (like, you've created a bunch of admin aliases and can think of a better way to do this).


Aye.

NikLP's picture
NikLP - Mon, 2007-12-31 19:43

What I have gathered from conversing with Greggles: This means that users will have to manually check their url settings per node, for each node that had a manually set url, until all of them have been re-saved, and thereafter each of those nodes will have an entry in the proposed new tables, and the setting will be "remembered" in perpetuity...

This is true for all sites that will upgrade from 1.x or 2.0 to 2.1+, but any users that use PA 2.1 (NB: I have assumed this version number) at the outset of a site build will not be affected.

Having discussed this at some length with Greg, I can't see a less intrusive way of getting this (imo, required) functionality in play, so I agree with the proposal.

Kineta Systems - Web Development in Nottingham, UK