Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2009 at 14:17 UTC
Updated:
12 Mar 2010 at 00:08 UTC
function mymodule_views_data() {
...
$data['mymodule']['myfield'] => array(
'title' => t('My module field'),
'help' => t('Help text'),
'field' => array(),
);
..
return $data;
}
The field "My module field" will not show up because of too restrictive validation checking. As it is sufficient to define title, group or help outside the field array the $info[$key] variable should be allowed to be empty.
--- includes/admin.inc 7 Apr 2009 20:48:28 -0000 1.154
+++ includes/admin.inc 23 Aug 2009 13:55:58 -0000
@@ -2893,7 +2893,7 @@ function views_fetch_fields($base, $type
continue;
}
foreach (array('field', 'sort', 'filter', 'argument', 'relationship') as $key) {
- if (!empty($info[$key])) {
+ if (is_array($info[$key])) {
if (!empty($info[$key]['skip base'])) {
foreach ((array) $info[$key]['skip base'] as $base_name) {
$skip_bases[$field][$key][$base_name] = TRUE;
Greetings,
sevi
| Comment | File | Size | Author |
|---|---|---|---|
| views-field-definition.patch | 794 bytes | sevi |
Comments
Comment #1
dawehnerUpdate status
Patch looks fine for me
Comment #2
merlinofchaos commentedBut 'field' => array() is not truly valid. It's also more obscure in terms of reading to see what's going on. I don't think I agree with this.