When I visit the video node I see the following warning:

Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /includes/entity.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aeternum’s picture

I can confirm this issue. It happened after my first attempt at uploading a video and was followed with an SQL error on Microsoft SQL Server Express:

PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting the nvarchar value 'Remove' to data type int.: SELECT base.fid AS fid, base.uid AS uid, base.filename AS filename, base.uri AS uri, base.filemime AS filemime, base.filesize AS filesize, base.status AS status, base.timestamp AS timestamp FROM {file_managed} base WHERE ( (base.fid IN (:db_condition_placeholder_0_fid, :db_condition_placeholder_0_upload_button, :db_condition_placeholder_0_remove_button, :db_condition_placeholder_0_upload)) ); Array ( [:db_condition_placeholder_0_fid] => 0 [:db_condition_placeholder_0_upload_button] => Upload [:db_condition_placeholder_0_remove_button] => Remove [:db_condition_placeholder_0_upload] => ) in DrupalDefaultEntityController->load() (line 196 of D:\inetpub\wwwroot\drupal7\includes\entity.inc).

A debug_backtrace shows it originates from the Video module, by generating an array that cannot be flipped.

heshanlk’s picture

@Aeternum , to reproduce let me know the process u followed.

timothykc’s picture

subscribed. No SQL error for me, but getting identical error message "Warning: array_flip() [function.array-flip]:..." after uploading a video and then viewing node.

heshanlk’s picture

What are the your configurations on field? did you select video thumbnail auto creation? did u upload a default video thumbnail image?

anglo’s picture

Posted all settings below.

heshanlk’s picture

P2790’s picture

subscribing

P2790’s picture

Module does not work at all for me because of this, cannot even upload a video

vlamor’s picture

Standard configuration of the Video field. The same errors...

heshanlk’s picture

Please send me your configurations? What are the configurations you have for the field? Enabled the auto conversion? Thumbnail creation method? provide more details to reproduce

anglo’s picture

Video node settings
Required field: Checked
Allowed file extensions: mp4, ogg, avi, mov, wmv, flv, ogv, webm, 3gp
File directory: videos/original
Maximum upload size: Not set
Default Video Resolution Dimensions: 640x480
Progress indicator: Bar with progress meter
Default Video Player Dimensions: 320x240
Number of values: 1
Upload destination: Public files
Enable video conversion: Checked
Thumbnail Generation: Automatically generate thumbnails
Default video thumbnail: Not set
Preview thumbnail style: thumbnail

Video node edit page
Bypass auto conversion: Unchecked
Convert video on save: Checked
Use the default thumbnail for this video?: Unchecked

General
Automatically start video on page load: Unchecked
Automatically start video buffering: Checked
Bypass video conversion: Unchecked
Video convert on node submit: Checked
Override video thumbnails with default thumbnail: Unchecked
Publish when conversion complete: Unchecked

Transcoders
Locally Installed Transcoders
Enable the use of nice when calling the command.: Checked
Path to save thumbnails: videos/thumbnails
Number of thumbnails: 1
Save all thumbnails in {file_manged} table: Unchecked
FFMPeg Padding method: Use -padtop, -padbottom, -padleft, -padright for padding

Manage preset
Use preset WxH for video conversion.: Checked

vlamor’s picture

I have the same settings... And the same error...

heshanlk’s picture

In which page u get this notice? Node edit, Play video? or where?

anglo’s picture

When I visit the video node page. (View video node page)

naterockhold’s picture

Also having the same issue.

zamir’s picture

I have the same error!

mrfree’s picture

subscribe, I see that warning message everywere... front page too

mrfree’s picture

Another, I hope useful, info... that warn message appears twice for each published node that contains video.

If I have 2 published node w/ video published I have 4 array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! message in the front page, If I remove one of them from publishing I have only 2 array_flip() warning messages on the front page

mrfree’s picture

FileSize
783 bytes

I've found (and I hope squashed) that bug... but please review the attached patch to check if I got that file_load() logic correctly.

mrfree’s picture

Status: Active » Needs review
vood-1’s picture

Errors disappear, nice :) Did not test it well, but looks ok

heshanlk’s picture

Status: Needs review » Fixed

Added to the dev

vanrijnr1’s picture

Project: Video » Marinelli
Version: 7.x-1.0-alpha1 » 7.x-3.0-beta9

Hi,

I've got the same issue. Same error, with 'line 178 of /includes/entity.inc' and same for line 354.

Not sure how to use that patch, where to put it, as I'm still learning...

Roy

livemedialab’s picture

Yesterday i've installed video module and got the same issue.
After a long research i found this thread and applied the patch above, so the problem eclipsed!
Thanks alot mrfree :)
I will keep on eye if everything went fine and if the problem re-appear.

anglo’s picture

Project: Marinelli » Video
Version: 7.x-3.0-beta9 » 7.x-1.x-dev
andrezyk’s picture

With the patch from #19, the errors stopped for me also!
Thanks mrfree!

Status: Fixed » Closed (fixed)

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

silvio’s picture

Status: Closed (fixed) » Needs review
FileSize
2.34 KB

I get the same error after saving a node without thumbs when ffmpeg can't generate images from the uploaded video. This happens even with the patch from #19. The attached patch (also available here) fixes the problem.

The fix for my issue is the diff from video.module. The changes at video.field.inc are most intended to keep this kind of check uniform along the module.

nemo_Anhoa’s picture

Does this patch apply for the 7.x-1.0-alpha2 ?
I try the patch for this version , but it failed.
Do I have to update to the latest 7.x-2-dev ?

Many thanks in advance,

interX’s picture

Status: Needs review » Reviewed & tested by the community

#29 works (against 7.x-1.x-dev)

gagarine’s picture

#29 work for me too

heshanlk’s picture

Status: Reviewed & tested by the community » Closed (fixed)
gatsby0121’s picture

@nemo_Anhoa did you ever get it working for 7.x-1.0-alpha2?