Closed (fixed)
Project:
Brightcove Video Connect
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2010 at 11:21 UTC
Updated:
31 Mar 2011 at 19:01 UTC
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
| Comment | File | Size | Author |
|---|---|---|---|
| brightcove_cck_module.patch | 457 bytes | timhilliard |
Comments
Comment #1
marek.trunkat commentedAlready fixed in 6.x-1.x.
Comment #2
timhilliard commentedCool I guess we should close ticket then