Closed (fixed)
Project:
Browscap
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Mar 2011 at 18:27 UTC
Updated:
8 Feb 2012 at 21:00 UTC
Jump to comment: Most recent file
Saw the following notice in my watchdog:
| message | PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'parent' at row 1: INSERT INTO {browscap_statistics} (parent, counter, is_crawler) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.6; chromeframe/10.0.648.151; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; eSobiSubscriber 2.0.4.16; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; .NET CLR 1.1.4322; .NET4.0C; AskTbBLPV5/5.9.1.14019) [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1 ) in browscap_exit() (line 98 of /var/www/sites/all/modules/browscap/browscap.module). |
Comments
Comment #1
pillarsdotnet commentedAttached patch fixes the problem by truncating HTTP_USER_AGENT string to 255 characters.
Comment #2
pillarsdotnet commentedbump.
Comment #3
troybthompson commentedConfirmed that this patch fixes the same error one of my users was getting.
Comment #4
bernard63 commentedHi,
I am a French Drupal beginner (sorry for my language)
I have the same problem with the Agregator module.
Is HTTP_USER_AGENT a phpmyadmin value for browscape.module, or where is it ?
I search in all direction to resolve my problem.
Thank you for a response.
Bernard
Comment #5
devin carlson commentedThe patch in #1 applies cleanly and fixes the issue of having user agent names which are longer than the maximum size allowed by the parent column (255 characters).
The issue occurs because
browscap_exitsuccessfully truncates$browser['parent']when a default browser is not found but does not truncate$_SERVER['HTTP_USER_AGENT']when a default browser is found.bernard63, for issues concerning maximum data lengths and the Aggregator module, please see:
Comment #6
devin carlson commentedCommitted to 7.x-1.x.
Comment #7
devin carlson commentedBackport of #1.
Comment #8
devin carlson commentedCommitted to 6.x-1.x.