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.
Problem/Motivation
Max length is not set on photo set id and nsid fields while database schema sets varchar limit to length of 64.
As a result, the fields default to form api's 128, allowing user to submit form with value greater than database will allow:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column...
Proposed resolution
Add maxlength of 64 to id and nsid fields.
Remaining tasks
Review forthcoming patch.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#3 | flickrfield_maxlength-2461057-3.patch | 5.49 KB | lolandese |
Comments
Comment #1
joewhitsittComment #2
joewhitsittComment #3
lolandese CreditAttribution: lolandese commentedAlthough a bit theoretical as no Flickr photo, set or user IDs longer than 64 characters exist, it makes sense to have maxlength and varchar limit both set and to be of the same value.
Attached patch extends this also for the flickr photoset field. It also moves the function hook_field_schema more appropriately to the flickrfield.install file.
Furthermore it corrects an 'undefined index' error for the flickr photoset field that slipped in after #2429025: Exact date and time on hover of the 'time ago' in the caption.
Comment #5
lolandese CreditAttribution: lolandese commentedThanks again for your contribution.