Allow users to set aliases longer than 128 if database supports it
giorgio79 - May 23, 2008 - 13:46
| Project: | Pathauto |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Hi,
I may have some urls aliases that are longer then 128 (slightly more)
Having read this http://drupal.org/node/54481 I was wondering if I alter the underlying table structure to allow for 255, there is still the pathauto limit.
Has anyone removed the 128 limit yet in pathauto?
Cheers,
G

#1
I believe that if you search the code for 128 you'll find the places to change this. Of course, then you'll be using a modified version of Pathauto which means more work every time you upgrade Pathauto.
I hope you don't mind me changing this to a feature request. I don't plan on providing more support for this, but if someone wanted to modify Pathauto so that it would figure out the underlying table structure and set a higher limit based on that I would accept the patch.
#2
Hm. Wouldn't this be possible using the Schema API? It would be interesting to play with for 6.x-2.x... :) (It would also be great if it was somehow possible to assign issues to 6.x-2.x-dev - is this possible, Greg? I'm pretty sure "7.x" was listed for core before 6.x was branched out/development opened, but...)
#3
While it's possible, I don't want to be messing with the core tables. If someone else wants to do that on their site, that's fine. There was an instance in the past where Pathauto increased the size of the system table, but...that was a change that core had in a newer version already and which was causing a bug with CCK (which makes it hard to ignore).
For a feature request, though, I don't think we should be modifying a core table.
#4
Ah, but I'm not suggesting we alter any tables. :) I looked into the database functions yesternight and didn't find what I wanted, so perhaps it isn't as I hoped, but what I wanted was for Pathauto to use something like
$alias_length = get_schema('url_alias'); $alias_length = $alias_length['fields']['dst']['length'];and then use$alias_lengthto determine our max length of the alias table. Thus, we'll be ready to follow core if they change, and it's one less worry for people who need to alter it themselves.#5
I see what Freso means. Patch attached for review that will allow pathauto to be ported a little easier to future Drupal versions when the {url_alias}.dst length changes.
#6
I haven't tested the patch, but the code looks fabulous! Thank you, Dave. =)