There seems to be a bug in cp/content_publish.php. (Build 20101220)
The error is:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: assigned_channels
Filename: cp/content_publish.php
Line Number: 2122
As you can see in the function code there is no way for $assigned_channels to be set. If you are logged in as an admin it never get’s parsed and hence no error notice.
FYI. I don’t have time to file a bug report, so I thought I’d post it here.
/**
* Build Channel Select Options Field
*
* @return array
*/
private function _build_channel_select()
{
$menu_channel_options = array();
$menu_channel_selected = '';
$query = $this->channel_model->get_channel_menu(
$this->_channel_data['status_group'],
$this->_channel_data['cat_group'],
$this->_channel_data['field_group']
);
if ($query->num_rows() > 0)
{
foreach ($query->result_array() as $row)
{
if ($this->session->userdata['group_id'] == 1 OR in_array($row['channel_id'], $assigned_channels))
{
if (isset($_POST['new_channel']) && is_numeric($_POST['new_channel']) && $_POST['new_channel'] == $row['channel_id'])
{
$menu_channel_selected = $row['channel_id'];
}
elseif ($this->_channel_data['channel_id'] == $row['channel_id'])
{
$menu_channel_selected = $row['channel_id'];
}
$menu_channel_options[$row['channel_id']] = form_prep($row['channel_title']);
}
}
}
$settings = array(
'new_channel' => array(
'field_id' => 'new_channel',
'field_label' => lang('channel'),
'field_required' => 'n',
'field_instructions' => '',
'field_type' => 'select',
'field_pre_populate' => 'n',
'field_text_direction' => 'ltr',
'field_list_items' => $menu_channel_options,
'field_data' => $menu_channel_selected
)
);
$this->api_channel_fields->set_settings('new_channel', $settings['new_channel']);
return $settings['new_channel'];
}