The following error occurs when someone tries to insert a video with an id that is longer than 15 characters, e.g. https://www.youtube.com/watch?v=kk6Mk7QHgso12345

"PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column."

Comments

mpp’s picture

Status: Active » Needs review
StatusFileSize
new473 bytes

I wrote a patch to validate the video url length to be less than the available size in the database column.

  • guschilds committed 15106dd on 8.x-1.x
    Issue #2410157 by mpp, guschilds: Prevented attempt to save video ID...

  • guschilds committed d66179e on
    Issue #2410157 by mpp, guschilds: Prevented attempt to save video ID...
guschilds’s picture

Status: Needs review » Fixed

Thanks for pointing this out and for supplying a patch, mpp. I added the check to youtube_field_validate() and committed it to the 7.x-1.x branch. I've also committed a similar check to the 8.x-1.x branch.

mpp’s picture

Status: Fixed » Closed (fixed)

Gus, I had another look at it and it seems that the validation needs to happen in the Youtube field itself in youtube_input_validate (see my patch).
When using your patch, I still get an error after submitting a url like http://www.youtube.com/watch?v=1SqBdS0XkV41SqBdS0XkV41SqBdS0XkV41SqBdS0XkV4

mpp’s picture

Status: Closed (fixed) » Needs work
guschilds’s picture

Status: Needs work » Postponed (maintainer needs more info)
StatusFileSize
new24.99 KB

mpp, When I test the URL you've provided on that release, I correctly receive the "Please provide a valid YouTube URL." validation error. I'm not able to reproduce what you're experiencing. I'll attach a screenshot of what I'm seeing. Are you testing the 7.x-1.5 release. If not, could you? Thanks.

guschilds’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing again after a month of inactivity. I tested this again with 7.x-1.5 and I get the correct error when using the URL supplied in #5. The error comes from the commit in #3 and reads "Please provide a valid YouTube URL."