Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a really long URL, 294 characters; even longer when I convert symbols into URL safe characters. It gets truncated to 255 characters.
Comment | File | Size | Author |
---|---|---|---|
#37 | 376818-37.patch | 1.26 KB | Thomas_Zahreddin |
#14 | longer-urls-376818-14.patch | 3.67 KB | dropcube |
#11 | longer-urls-376818.patch | 3.63 KB | dropcube |
#9 | 376818_wInst.patch | 2.97 KB | jeffschuler |
#4 | link_URL_length_fix.patch | 1.68 KB | pauline_perren |
Comments
Comment #1
lemmax CreditAttribution: lemmax commentedSame problem here. For example,
http://th.wikipedia.org/wiki/%E0%B9%82%E0%B8%A3%E0%B8%87%E0%B9%80%E0%B8%...
is truncated and thus made useless. It should link to a website with a url in Thai language, and in Thai it's not really that long a URL. The limit should be set to at least 512 characters or preferably more.
Comment #2
pauline_perren CreditAttribution: pauline_perren commentedI'm having this issue too.
Apparently Explorer won't accept URLs longer than 2048 so maybe that could be the cut-off ...
Comment #3
marcp CreditAttribution: marcp commentedThe 'database columns' case in
link_field_settings()
tells CCK how big to make the url field -- it's set to 255.I only found this issue because folks are asking for longer urls in the userlink queue, and I was checking here to see what link does since it should be the de-facto standard (and since userlink should be built on top of CCK/Link).
Is 255 really big enough?
Comment #4
pauline_perren CreditAttribution: pauline_perren commentedHere is a patch to update the URL length to 2048. You will have to manually update any existing database columns from 255 to 2048 but this patch will cause any new fields created to be the new length. It also allows the longer URLs to be entered via the form when creating new content.
Comment #5
jeffschulerComment #6
marcp CreditAttribution: marcp commentedI suspect this patch won't get accepted without a corresponding hook_update_N() in the .install file.
Comment #7
pauline_perren CreditAttribution: pauline_perren commentedUnfortunately I can't see how to tell which database columns have been generated by this module and need to be automatically updated. Presumably someone who knows the module better would know. Can anyone help with this?
Comment #8
vgarvardt CreditAttribution: vgarvardt commentedI'm having the same problem.
So, What about accepting this patch?
New update link_update_6001 introduced in 6.x-2.6-beta1 updates all link fields with new length.
Comment #9
jeffschulervgarvardt, I'm confused about how
link_update_6001()
updates link fields with new length. Sorry if I'm missing something.I've re-rolled the patch in #4 against 6.x-2.6-beta1, and included a new link.install function:
link_update_6200()
to update the url column lengths to 2048.I used
link_update_6001()
as a model for doing so. Not sure if there's a simpler way to choose the url column... I'm grateful for corrections!Comment #10
vgarvardt CreditAttribution: vgarvardt commentedYes, this patch works fine.
It would be great if this patch will be applied in the next release.
Thanks.
Comment #11
dropcube CreditAttribution: dropcube commentedThe patch looks good, an it works. Also tested the upgrade function, and all links fields are converted correctly to the new database type. Some minor comments about the patch:
Would be good to add some PHPdocs to the function, to indicate the changes being done.
Not required to explicitly typecast this.
Constant should be used directly.
The attached patch fixed the above.
Also, it renames the constant URL_MAX_LENGTH to LINK_URL_MAX_LENGTH, which is in the module namespace, like the other constants the module defines.
Comment #12
andrewlevine CreditAttribution: andrewlevine commentedtested this patch on two of our websites that were affected by the bug -- worked fine. Patch looks good to me too. Hoping this gets into 6.x-2.7 -- let me know if there's anything else I can do
Comment #13
andrewlevine CreditAttribution: andrewlevine commentedsetting as RTBC. let me know if you need anything else to commit this.
Comment #14
dropcube CreditAttribution: dropcube commentedUpdated patch against the 6.x-2.x branch.
Comment #15
coltranePatch looks good and applies (with some muddling -- it should be rolled from within the Link module directory) still and it works!
Comment #16
jcfiala CreditAttribution: jcfiala commentedThanks for all the feedback - I'll attempt to apply this patch to cvs in the next few days.
Comment #17
jcfiala CreditAttribution: jcfiala commentedOkay, added the patch, it seemed to work, did a little testing, looked good, added a simpletest which uses the really long url supplied above (thank you), and committed this.
So, all good.
Comment #19
apanag CreditAttribution: apanag commentedHello,
when do you plan to release a new version?
thanks,
apanag
Comment #20
jcfiala CreditAttribution: jcfiala commentedWhen I'm able to spend the time to get it wrapped up. I've still got a bug that I haven't been able to properly squash yet that I don't want to have in 2.9, and sadly professional duties have kept me really busy.
Plus, I really do need to start on the version for Drupal 7.
Comment #21
apanag CreditAttribution: apanag commentedΟΚ,
Τhanks for your answer. Keep up the good work.
Comment #22
tinem CreditAttribution: tinem commentedI'm not sure if my problem is the same but my long URL get cut off when using CCK Link and URL showing Google Maps StreetView.
I really need some help because I don't know how to use a patch and if I search in the database I can't find this link_field_settings() ?
My site is going to be showed on a Conference hear in Copenhagen so really need some help at soon as possible, please?
At this site http://www.tinemuller.dk/test_drupal/list_koebenhavn look for the links showing Google Maps API StreetView and click. So it's functioning but NOT with really long URLs. :-(
Comment #23
tinem CreditAttribution: tinem commentedComment #24
andrewlevine CreditAttribution: andrewlevine commentedbug fixed in the latest dev version of the module. Please don't reopen unless the bug is still there.
http://drupal.org/patch for information on patches
Comment #25
tinem CreditAttribution: tinem commentedSorry I'm not so used to all this. So can I just download link-6.x-2.x-dev.tar and update module and it should functioning?
Edited: In my table content_type_copenhagen I have a field called:
field_streetview_url - varchar(255)
field_streetview_title - varchar(255)
field_streetview_attributes - mediumtext
Do I also need to change something here, please?
Comment #26
tinem CreditAttribution: tinem commentedEverything is functioning now. Didn't change anything in the database just uploded developer version. THANKS - also got a little help from support IRC from camidoo :-)
Comment #27
andrewlevine CreditAttribution: andrewlevine commentedJust be aware the dev version has not been marked yet as a stable release by the maintainer.
Comment #28
tinem CreditAttribution: tinem commentedNow I have a problem again and I have uploaded the Dev version and all is up-to-date.
I have a problem with the URL for StreetView - it should be like this
http://maps.google.com/maps?f=q&hl=da&geocode=&q=Sankt+Hans+Torv,+N%C3%B8rre+All%C3%A9+2+%40+55.69137,12.56125&ie=UTF8&hq=&hnear=&ll=55.691369,12.561252&spn=0.000841,0.001725&t=h&z=19&layer=c&cbll=55.69139,12.560908&panoid=VFIymPDCZZeAulMTXUlMIg&cbp=12,92.83,,0,6.47
but it is like this
http://maps.google.com/maps?f=q&hl=da&geocode=&q=Sankt+Hans+Torv,+N%C3%B8rre+All%C3%A9+2+%40+55.69137,12.56125&ie=UTF8&hq=&hnear=&ll=55.691369,12.561252&spn=0.000841,0.001725&t=h&z=19&layer=c&cbll=55.69139,12.560908&panoid=VFIymPDCZZeAulMTXUlMIg&cbp=12,92
so .83,,0,6.47 is cut of and even if I paste this after the code and there is room for it the code is deleted when I click the StreetView URL. Can someone help, please?
http://www.tinemuller.dk/test_drupal/node/6
Comment #29
tinem CreditAttribution: tinem commentedI didn't found a solution but I deleted some of the address from:
Sankt Hans Torv, Nørre Allé 2
to
Sankt Hans Torv
and the new URL is now:
http://maps.google.com/maps?f=q&hl=da&geocode=&q=Sankt+Hans+Torv+%40+55.69137,12.56125&ie=UTF8&hq=&hnear=&ll=55.691369,12.561252&spn=0.000841,0.001725&t=h&z=19&layer=c&cbll=55.69139,12.560908&panoid=VFIymPDCZZeAulMTXUlMIg&cbp=12,99.07,,1,4.46
and it's functioning. But I HATE when i can't figure out what the problem was and it's not good that I have to delete some of the address. :-(
You can try it click here on StreetView from InfoWindow http://www.tinemuller.dk/test_drupal/node/6?nid=1219
Comment #30
tinem CreditAttribution: tinem commentedI have some problems with these long links.
I can't update the module from vers. 8 to 9 - it keeps saying that it is vers. 8?
Schema Mismatch
What is going wrong here. Hope someone can help, please?
Comment #31
jcfiala CreditAttribution: jcfiala commentedFirst off, you need to set the status to Active when you're following up on the question.
Secondly, the error is complaining that it's expecting the field to be able to contain 2048 characters, and yet your database is set to only contain 255. I don't have the time to look at the code right now, as I'm heading off to work. I'll see if I can't take a little time this weekend and get back to you.
I realize you're frustrated about not hearing back, but we're all volunteers, remember! :)
Comment #32
tinem CreditAttribution: tinem commentedThanks for reply. I uploaded 6.x-2.x-dev again which I think I did long time ago but hadn't forgotten. But I still have this message about the table but the color for the link is now green but says Recommended version: 6.x-2.9 (2010-Jun-14)
Comment #33
tinem CreditAttribution: tinem commentedComment #34
jeffschuler@tinem, did you run update.php after installing 6.x-2.x-dev?
What do you get when you query your site database like this:
needs work status on an issue [here in the issue queue] is for when a patch under review requires modification. Let's set this issue to back to active since we're not sure where the problem lies.
Comment #35
tinem CreditAttribution: tinem commentedSorry for all the noise I make but I'm not used to make changes and issues but we all have to learn right and I'm struggling hard. :-)
I remember I changed something as explained earlier in this thread but can't remember what I did. I have vers. 6.x-2.9 installed now and all is up to date and I think if I hadn't installed module Schema I would't have noticed this error and can't figure out if it's important or not?
I pasted your code
in my phpadmin SQL and it shows schema_version 6002 but when I look under modules which is up to date it mentiones vers. 6.x-1.7 - could this be the problem or?
Should I have made changes to your code?
Comment #36
jeffschulerIt doesn't look like
link_update_6200()
from @dropcube's patch in #14 was ever committed.@jcfiala?
Comment #37
Thomas_Zahreddin CreditAttribution: Thomas_Zahreddin commentedas it seems there is the hook_update_n missing from the patch of comment #14, so i reworte it.
Comment #38
tinem CreditAttribution: tinem commentedSo shall I do something and if yes what, please?
Comment #39
tinem CreditAttribution: tinem commentedI still have this problem. Shouldn't it be included in a new versions? I use 6.x-2.9 which I think should be the latest for Drupal 6, right?
When I make this link
http://maps.google.com/maps?f=q&source=s_q&hl=da&geocode=&q=56+09+29.658...
it's cut of to this
http://maps.google.com/maps?f=q&source=s_q&hl=da&geocode=&q=56+09+29.658...
what is missing is this
g&cbp=12,344.98,,0,5.23
I'm surprised that it's should be SO difficult. Know you all are doing this for free but please make this functioning and not a patch which I can't understand, sorry.
Comment #40
tinem CreditAttribution: tinem commentedWhen I look in phpmyadmin in the content type where the link is NOT functioning it says:
field_streetview_url varchar(255)
field_streetview_title varchar(255)
but if I look in another site made later I see this which I think should be the correct:
field_streetview_url varchar(2048)
field_streetview_title varchar(255)
But can't figure out how to make it like this?
Comment #41
vgarvardt CreditAttribution: vgarvardt commented@tinem
Try patch from #37
Comment #42
tinem CreditAttribution: tinem commentedWhy isn't it included in the updates versions?
Comment #43
tinem CreditAttribution: tinem commentedMy host doesn't support SSH which I have read that you need - can't i just change link.install and upload it to the link folder?
Comment #44
sydneyshan CreditAttribution: sydneyshan commentedDoesn't VARCHAR have a limit of 255 characters in < MySQL 5.0.3? Is there any checks for this before defining it as 2048?
I've just manually updated all my _url fields to be 2048 to avoid schema module errors. It would be great if an update function could fix these field definitions automatically.
From http://dev.mysql.com/doc/refman/5.0/en/char.html
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions. The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used.
Comment #45
jenlamptonIt looks like this was fixed at some point, because people have been complaining about it. See #838902: Row size too large MySQL error when adding multiple link fields to single content type