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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joewhitsitt’s picture

joewhitsitt’s picture

Status: Active » Needs review
lolandese’s picture

Although 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.

  • lolandese committed e8b604f on 7.x-1.x authored by jwhitsit
    Issue #2461057 by jwhitsit, Flickr Field id/nsid - Set a maxlength
    
lolandese’s picture

Status: Needs review » Fixed

Thanks again for your contribution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.