Many URLs are longer than 255 characters—particularly Facebook/social referral URLs. As a result, recording referrals from these sources causes a SQL error:

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'http_referer' at row 1: INSERT INTO {referral} (uid, referral_uid, created, host, http_referer) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( ... ) in _referral_user_save() (line 205 of .../referral/referral.module).

In my opinion, http_referer should be a TEXT column to fix this issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AlexKirienko’s picture

We have same issue for users signed up from Facebook.

AlexKirienko’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
1.32 KB

Please check attached patch.

SocialNicheGuru’s picture

rerolled with latest dev version (11/2016)

SocialNicheGuru’s picture

FileSize
1.01 KB

Updated the update hook # so as not to conflict.