CCK Link URL's with and without http:// should be classified as unique

enzipher - July 6, 2009 - 19:02
Project:Unique field
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:won't fix
Issue tags:link, patch, unique field
Description

Hi there,

There seems to be a minor issues when using Unique field with the CCK Link module. Unique field treats http://www.example.com and www.example.com as different URL's, which in fact is the same.

CCK Link allow URL's with and without the http part, which I personally find to be bad practice, but now it's like that so perhaps Unique field could make this check?

Thanks!

#1

detour - November 13, 2009 - 00:59
Status:active» won't fix

I can't make this change. I agree that it makes sense, but it compromises the general purpose nature of this module. I suggest reporting this as an issue to the CCK Link module, because it does seem helpful that the URL stored in the database is full and proper.

#2

dmp1ce - November 16, 2009 - 05:18
Issue tags:+link, +patch, +unique field

I also needed this functionality so I created a patch to do this. I realize this is set to won't fix but unique_field seemed like the best place to add this functionality.

I'm sure there are some problems with the patch because I haven't tested some configurations. What the patch does is give the option to do some additional checking for link field types. This can be turned on in the Unique field settings section of the node type settings. I have only tested it with Content Type scope and with the Link set to 1 field.

The patch was made against the 6.x-1.x-dev on Nov. 13th.

AttachmentSize
unique_field_link.patch 4.79 KB

#3

dmp1ce - November 28, 2009 - 21:59

I've added some additional checks for checking whether a link is a unique or not. I'm posting here for whoever is interested.

The additional checks are:

With or without the 'www.' in the domain section of the URL
With or without the 'http://' in the URL
With or without a trailing '/' in the URL
Option to trim clear space before and after the URL.

Additional checks options are available in the Unique field settings section.

AttachmentSize
unique_field_links-6.x-1.x-dev.patch 10.62 KB
 
 

Drupal is a registered trademark of Dries Buytaert.