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

greggles - May 23, 2008 - 21:33
Title:Remove 128 limit from url alias?» If database supports aliases longer than 128 allow users to set longer aliases
Version:5.x-2.2» 6.x-1.x-dev
Category:support request» feature request

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

Freso - May 23, 2008 - 22:54
Title:If database supports aliases longer than 128 allow users to set longer aliases» Allow users to set aliases longer than 128 if database supports it

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

greggles - May 24, 2008 - 00:09

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

Freso - May 24, 2008 - 08:16

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_length to 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

Dave Reid - July 3, 2009 - 23:31
Version:6.x-1.x-dev» 6.x-2.x-dev
Status:active» needs review

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.

AttachmentSize
261944-schema-maxlength-D6-2.patch 2.32 KB

#6

Freso - July 6, 2009 - 19:44

I haven't tested the patch, but the code looks fabulous! Thank you, Dave. =)

 
 

Drupal is a registered trademark of Dries Buytaert.