I have created a simple node type that is just a title and a decimal. I have also entered several example nodes.
I have created a view that presents the data as a table:
$view = new stdClass();
$view->name = 'trans_summary';
$view->description = 'A summary of transactions';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'A summary of transactions';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'view/transactions';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title',
'handler' => 'views_handler_field_nodelink',
),
array (
'tablename' => 'node_data_field_amount',
'field' => 'field_amount_value',
'label' => 'Amount',
'sortable' => '1',
),
);
$view->filter = array (
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_amount);
$views[$view->name] = $view;
This creates the following html:
<tbody>
<tr class="odd"><td class="view-field" id="view-field-node_title"><a href="/node/4">Test 4</a></td><td class="view-total-number active" id="view-field-node_data_field_amount_field_amount_value">223.01</td> </tr>
<tr class="even"><td class="view-field" id="view-field-node_title"><a href="/node/1">Test 1</a></td><td class="view-total-number active" id="view-field-node_data_field_amount_field_amount_value">1000</td> </tr>
<tr class="odd"><td class="view-field" id="view-field-node_title"><a href="/node/3">Test 3</a></td><td class="view-total-number active" id="view-field-node_data_field_amount_field_amount_value">12333</td> </tr>
<tr class="even"><td class="view-footer" id="view-field-node_title-3">Test 2</td><td class="view-footer active" id="view-field-node_data_field_amount_field_amount_value-3"> </td> </tr>
</tbody>
The value in the "amount" column and last row is just given as . If I make the column sortable by amount, it is the same - the final field is always empty. See attachment for screenshot.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | viewsbug2.png | 9 KB | talltim |
| Picture 1_2.png | 11.18 KB | talltim |
Comments
Comment #1
talltim commentedSame applies for integers - see screenshot again.
Comment #2
talltim commentedI think this is caused by the views_calc module that KarenS is working on - it goes away when I create a calculation for a particular view.
Comment #3
merlinofchaos commentedInteresting.
Comment #4
karens commentedIt's a bug in views_calc. I think I know the problem and will get a fix posted later today.
Comment #5
karens commentedDo a cvs update and it should be fixed. It was related to my effort to theme the results, and the whole process for themeing has been changed to take advantage of a new plugin in the views module. Let me know if this fixes things for you.
Comment #6
talltim commentedWorks great after update: problem solved.
Comment #7
(not verified) commented