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.
Hi,
I am not sure if this issue is caused by pathauto or not. But with pathauto enabled, saving a new content with title in utf8 would cause the following warning:
user warning: Data too long for column 'link' at row 1 query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (4, 'content', '@type: added %title.', 'a:2:{s:5:\"@type\";s:4:\"blog\";s:6:\"%title\";s:89:\"ทดสอบภาษาไทย อันนั้นหายยังหว่า\";}', 5, '<a href=\"/drupal/th/content/blog-entry/registered/17-%E0%B8%97%E0%B8%94%E0%B8%AA%E0%B8%AD%E0%B8%9A%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%84%E0%B8%97%E0%B8%A2-%E0%B8%AD%E0%B8%B1%E0%B8%99%E0%B8%99%E0%B8%B1%E0%B9%89%E0%B8%99%E0%B8%AB%E0%B8%B2%E0%B8%A2%E0%B8%A2%E0%B8%B1%E0%B8%87%E0%B8%AB%E0%B8%A7%E0%B9%88%E0%B8%B2\">แสดง</a>', 'http://localhost/drupal/th/node/add/blog', 'http://localhost/drupal/th/node/add/blog', '127.0.0.1', 1229507309) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\modules\dblog\dblog.module on line 144.
Comments
Comment #1
gregglesThe problem is that the data is too long for the "watchdog" table's link column.
http://www.boutell.com/newfaq/misc/urllength.html shows information for different browsers and web servers. Apache's limit s 4,000 characters. IE is 2083 characters. We should probably increase the link column to handle more information, though 2000 seems excessive. I think 200 or even 500 would probably be fine?
Also, you can use the Pathauto configuration under General Settings to limit the length of the URL which is 255 characters.
Comment #2
ball.in.th CreditAttribution: ball.in.th commentedJust wanna add that my Maximum alias length in pathauto was 100 and didn't prevent the warning. I guess pathauto counts the number of utf8 characters before getting converted to a proper URL. In my case, the title was in Thai and 1 Thai character takes 3 bytes in utf8 and, I think, 9 bytes to encode to a URL.
Comment #3
gregglesIf all of your urls are in Thai then you could adjust the setting down to some smaller number.
I'm not sure if it makes sense for Pathauto to check the length of the urlencoded url.
Comment #4
ball.in.th CreditAttribution: ball.in.th commentedJust got another idea. As 1 non-western , e.g. Thai or Japanese, utf8 character takes lots of bytes in an URL encoded format, the URL could get really long easily. It might be better to store the link column and all URL columns, in the database in utf8 and automagically convert to and from URL encoding as needed. 255 is still not long enough though.
Comment #6
Dave ReidThis has now been fixed by #223298: Change {dblog}.type VARCHAR limit from 16 to 64 which performs a substr() on the link to fit it into the database column.
Comment #7
etomilin CreditAttribution: etomilin commentedI'm not sure that using substr() on a link is a good idea, since it makes link useless.
This issue becomes really annoing if you use utf characters in urls, since almost any link of quite reasonable length exceeds 255 char's limit due to URL encoding.