Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
One of my taxonomy vocabs refuses to list the first term in the list, either in the admin interface or if I expose the filter. Taxonomy terms look like this, with weights from -5 through 5 to get the order right:
Vocab: Communities
=========================
Music
Art & Craft
Writing
New Media
Performance
Film
Fashion
Broadcast
Design
Photography
Views exposes in admin/exposed filters of type "Taxonomy: Terms for Communities" the following:
<select name="filter0" class="form-select" id="edit-filter0" >
<option value="**ALL**"><All></option>
<option value="2">Art & Craft</option>
<option value="3">Writing</option>
<option value="4">New Media</option>
<option value="5">Performance</option>
<option value="6">Film</option>
<option value="7">Fashion</option>
<option value="8">Broadcast</option>
<option value="9">Design</option>
<option value="10">Photography</option>
</select>
A look at the form with hook_form_alter reveals:
[filter0] => Array
(
[#type] => select
[#options] => Array
(
[**ALL**] => <All>
[1] => stdClass Object
(
[option] => Array
(
[2] => Art & Craft
)
)
[2] => stdClass Object
(
[option] => Array
(
[3] => Writing
)
)
[3] => stdClass Object
(
[option] => Array
(
[4] => New Media
)
)
[4] => stdClass Object
(
[option] => Array
(
[5] => Performance
)
)
[5] => stdClass Object
(
[option] => Array
(
[6] => Film
)
)
[6] => stdClass Object
(
[option] => Array
(
[7] => Fashion
)
)
[7] => stdClass Object
(
[option] => Array
(
[8] => Broadcast
)
)
[8] => stdClass Object
(
[option] => Array
(
[9] => Design
)
)
[9] => stdClass Object
(
[option] => Array
(
[10] => Photography
)
)
)
[#weight] => -15
[#theme] => taxonomy_term_select
)
As you can see, the first term (tid = 1, Music) is not appearing at all. =(
Sample view code is here - this happens every time I try to use this vocabulary though, not only in this view:
$view = new stdClass();
$view->name = 'browse_images';
$view->description = 'Browse view of all images';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Images';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = 'No videos uploaded.';
$view->page_empty_format = '1';
$view->page_type = 'node';
$view->url = 'content/images';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
);
$view->field = array (
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'image',
),
),
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => '2',
1 => '3',
2 => '4',
3 => '5',
4 => '6',
5 => '7',
6 => '8',
7 => '9',
8 => '10',
),
),
);
$view->exposed_filter = array (
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'label' => 'Pick a community to browse',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
);
$view->requires = array(node, term_node_1);
$views[$view->name] = $view;
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedhttp://drupal.org/node/199675
Comment #2
greg.harveySorry. And thanks. =)