Hi I am getting this error in my logs but everything seems to be working ok.

Strict warning: Only variables should be passed by reference in template_preprocess_video_embed_field_embed_code() (line 355 of \sites\all\modules\contrib\video_embed_field\video_embed_field.module).

  // Prepare embed code
  if ($handler && isset($handler['function']) && function_exists($handler['function'])) {
    $variables['embed_code'] = drupal_render(call_user_func($handler['function'], $variables['url'], $variables['style_settings']));
  else {
    $variables['embed_code'] = l($variables['url'], $variables['url']);
Members fund testing for the Drupal project. Drupal Association Learn more


Nikit’s picture

Replace it:

  // Prepare embed code
  if ($handler && isset($handler['function']) && function_exists($handler['function'])) {
    $embed = call_user_func($handler['function'], $variables['url'], $variables['style_settings']);
    $variables['embed_code'] = drupal_render($embed);
  else {
    $variables['embed_code'] = l($variables['url'], $variables['url']);

Or you can move all function code to your theme as YOURTHEMENAME_preprocess_video_embed_field_embed_code() and replace there...

IgnacioAlonso’s picture

Thanks, It works

betz’s picture

i can confirm this bug, any way to have this committed?

iamcarrico’s picture

Status: Active » Reviewed & tested by the community
976 bytes

Confirm bug. Also can confirm the code works per the above suggestion.

Here is a patch from what @Nikit suggested.

jec006’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

tiikeri’s picture

Just perfect, thanks!

zakir.gori’s picture

I just install weebpal.com/product/education profile and got error and #1 is perfect solution.
Thanks Nikit

Makdomen’s picture

Thanks Nikit it works

thaistore’s picture

it just happened on my site

isnt this bug fixes, it is now over 2 years, how come i get the error, i use latest d7

VM’s picture

#10 you can compare the data of the #5 where the fix was committed and the data of the last release of the module. The commit is in -dev and a new version hasn't been rolled yet.