Download & Extend

PDOException: SQLSTATE[42000]

Project:Embedded Media Field
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) LIMIT 1 OFFSET 0' at line 1: SELECT f.uri AS uri FROM {file_managed} f WHERE (f.fid IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder_7, :db_condition_placeholder_8, :db_condition_placeholder_9, :db_condition_placeholder_10, :db_condition_placeholder_11, )) LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => 39 [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => [:db_condition_placeholder_3] => 1 [:db_condition_placeholder_4] => iI9vHMudU08 [:db_condition_placeholder_5] => youtube://v/iI9vHMudU08 [:db_condition_placeholder_6] => video/youtube [:db_condition_placeholder_7] => 0 [:db_condition_placeholder_8] => 1 [:db_condition_placeholder_9] => 1326179164 [:db_condition_placeholder_10] => video [:db_condition_placeholder_11] => 96bd41e5-f667-d1c4-4515-e9a22d477592 ) in emfield_widget_value() (line 107 of sites/all/modules/emfield/emfield.module).

Steps to duplicate:

- Set up a content type with embedded media fields
- Add video (I tried both the media:vimeo and media:youtube types.)
- Attempt to edit the node

I am thinking that this issue is with media.module, despite the error message referencing emfield.module, due to the fact that the emfield.module has not updated since October, and this is a recent regression, occuring just over the last few days (which did have an update to Media.)

Comments

#1

Priority:normal» major

Its still highly probable that the problem is with Emfield. The 2.x branch of Media has undergone a lot of changes, incl. API and spinning off the File Entity submodule to its own module, compared to the 1.x branch.

Many add-on modules for media does only work with the 1.x branch, often it is required to have two separate branches of them too.

Any chance you can test this with the Media 1.x branch and see if it breaks there too?

Bumping to major in any case.

#2

Project:Media» Embedded Media Field
Version:7.x-2.x-dev» 7.x-1.x-dev
Component:Media field» Code

No, this is definitely still a bug due to emfield.

#3

Found this error today, looks like the emfield_widget_value is using an entire array from $fid to display the value rather than just using the actual fid.

The attached patch should fix the issue.

AttachmentSize
emfield-PDOException4200-1399458-3.patch 517 bytes

#4

Status:active» needs review

#5

Status:needs review» reviewed & tested by the community

I can confirm that this patch works on my install.

(Thanks, tedavis. :) )

#6

I can also confirm that this patch works for me as well. I still couldn't edit a piece of content with a video link in it, even after I installed the patch. I had to remove the offending content and recreate it. Thanks for wicked sweet module, keep it up!

#7

works for me

#8

Works for me as well.

#9

Work for me too. Nice catch.

#10

Status:reviewed & tested by the community» fixed

#11

Status:fixed» reviewed & tested by the community

I don't think this should be set to fixed until the patch has been committed. Will make it much harder for the maintainers to find as well.

#12

Ditto, this patch does clear the error message described in the original post. After applying this one from #3 I can populate the embedded media field, save it and return to edit the node without errors.

#13

OK, now I've got more details. Tell me if this is an issue for another queue, but this looks like behavior new after the patch.

I am seeing that submitting the node with a correct URL from Vimeo or Blip and then returning to the node edit form the field shows a value different and incorrect than I entered. The new links are often not working. Here is a set from Vimeo and Blip, the top URL is what I have entered and the bottom is the value seen on the edit form:

http://vimeo.com/37548094
http://vimeo.com/?v=37548094

Attempting to save the node with the second changed value returns this error; "Video Embed: Found no valid media with that url."

http://www.blip.tv/file/292924/
http://blip.tv/?v=AZKVNQI

Attempting to save the node with the second changed value returns about a hundred sets of these errors:

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: document.write("<a href=\"http://blip.tv/?skin=iphone\" class=\"LastLink\"> in media_blip_get_rss() (line 176 of /Users/sean/dev/icateens_d7/sites/all/modules/media_bliptv/media_bliptv.module).
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in media_blip_get_rss() (line 176 of /Users/sean/dev/icateens_d7/sites/all/modules/media_bliptv/media_bliptv.module).
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 1081: parser error : Couldn't find end of Start Tag a line 1081 in media_blip_get_rss() (line 176 of /Users/sean/dev/icateens_d7/sites/all/modules/media_bliptv/media_bliptv.module).

Using a Youtube link actually works correctly. It changes this URL to the one listed below it:

http://youtu.be/Urx21kpsB40
http://youtube.com/watch?v=Urx21kpsB40

#14

Ok, I guess I'll leave this issue RTBC and break out the failures I see into their respective provider modules. The patch does clear that error like the original issue addressed.

Blip path problem: http://drupal.org/node/1469930
Vimeo path problem: http://drupal.org/node/1469934

nobody click here