Hi guys, I'm getting a warning about a variable not be set. The problem is occurring in the brightcove_cck.module and is on line 730 in the function brightcove_cck_forms.

function brightcove_cck_forms() {
  $args = func_get_args();
  $form_id = $args[0];
  if (strpos($form_id, "brightcove_cck_browser_form") === 0) {
    $forms[$form_id] = array('callback' => 'brightcove_cck_browser_form');
  }
  return $forms;
}

If the strpos check returns false then $forms will never have been set. This is what is triggering the warning. To fix we could simply declare $forms as an empty array before the check as shown

function brightcove_cck_forms() {
  $args = func_get_args();
  $form_id = $args[0];
  $forms = array();
  if (strpos($form_id, "brightcove_cck_browser_form") === 0) {
    $forms[$form_id] = array('callback' => 'brightcove_cck_browser_form');
  }
  return $forms;
}

I have included a patch to fix this problem.

Cheers,
Tim

CommentFileSizeAuthor
brightcove_cck_module.patch457 bytestimhilliard

Comments

marek.trunkat’s picture

Status: Active » Fixed

Already fixed in 6.x-1.x.

timhilliard’s picture

Status: Fixed » Closed (fixed)

Cool I guess we should close ticket then