I'm using the views module to create a listing of all members of a site I help maintain. I've created a new view with a page display and added the profile fields I want to appear in the listing to the default display. When I look at the view either through the live preview or the actual path, it seems as though the view is pulling an empty string as the value for each profile field for each user. In other words, I am getting a blank entry for each user.
I'm attaching two screen shots to better illustrate my problem. The first shows the settings on the page display, and the second is the resulting node (in table format).
Here is what I have tried:
- Clearing the views cache.
- Clearing the Drupal cache.
- Clearing my browser cache.
- Changing the style on the default and page displays from table to unformatted.
- Going in as an admin and re-submitting each of the user profiles.
- Double-checking that the user account I am using has all rights on the site.
- Double checked the page source to make sure the profile field data wasn't just being hidden by a CSS issue. It isn't in the HTML at all.
Also, whenever I try to save a view, I get the following message in a JavaScript message box: An error occurred at /admin/build/views/ajax/preview/members. The view seems to save fine, however.
Below is the code given when I export the view:
$view = new view;
$view->name = 'members';
$view->description = 'A listing of guild members.';
$view->tag = 'members';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'value_3' => array(
'label' => 'Guild Toon Name',
'alter' => array(
'alter_text' => 1,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_3',
'table' => 'profile_values_profile_guildtoon_name',
'field' => 'value',
'relationship' => 'none',
),
'value_6' => array(
'label' => 'Main Toon Name',
'alter' => array(
'alter_text' => 1,
'text' => '',
'make_link' => 1,
'path' => 'http://www.wowarmory.com/character-sheet.xml?r=Terenas&n=[value_6]',
'alt' => 'Armory Page',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_6',
'table' => 'profile_values_profile_main_name',
'field' => 'value',
'relationship' => 'none',
),
'value_4' => array(
'label' => 'Main Toon Class',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_4',
'table' => 'profile_values_profile_main_class',
'field' => 'value',
'relationship' => 'none',
),
'value_7' => array(
'label' => 'Main Toon Race',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_7',
'table' => 'profile_values_profile_main_race',
'field' => 'value',
'relationship' => 'none',
),
'value_5' => array(
'label' => 'Main Toon Level Bracket',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_5',
'table' => 'profile_values_profile_main_levelbracket',
'field' => 'value',
'relationship' => 'none',
),
'value' => array(
'label' => 'Alt Name 1',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value',
'table' => 'profile_values_profile_alts_name1',
'field' => 'value',
'relationship' => 'none',
),
'value_1' => array(
'label' => 'Alt Name 2',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_1',
'table' => 'profile_values_profile_alts_name2',
'field' => 'value',
'relationship' => 'none',
),
'value_2' => array(
'label' => 'Alt Name 3',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_2',
'table' => 'profile_values_profile_alts_name3',
'field' => 'value',
'relationship' => 'none',
),
'value_8' => array(
'label' => 'Notes',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'value_8',
'table' => 'profile_values_profile_otherinfo_notes',
'field' => 'value',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'value_3' => 'value_3',
'value_6' => 'value_6',
'value_4' => 'value_4',
'value_7' => 'value_7',
'value_5' => 'value_5',
'value' => 'value',
'value_1' => 'value_1',
'value_2' => 'value_2',
'value_8' => 'value_8',
),
'info' => array(
'value_3' => array(
'sortable' => 0,
'separator' => '',
),
'value_6' => array(
'sortable' => 0,
'separator' => '',
),
'value_4' => array(
'sortable' => 0,
'separator' => '',
),
'value_7' => array(
'sortable' => 0,
'separator' => '',
),
'value_5' => array(
'sortable' => 0,
'separator' => '',
),
'value' => array(
'sortable' => 0,
'separator' => '',
),
'value_1' => array(
'sortable' => 0,
'separator' => '',
),
'value_2' => array(
'sortable' => 0,
'separator' => '',
),
'value_8' => array(
'separator' => '',
),
),
'default' => '-1',
));
$handler = $view->new_display('page', 'Member Listing', 'page_1');
$handler->override_option('header', '<p>This page provides a listing of members in the guild who have signed up on the website.</p>');
$handler->override_option('header_format', '4');
$handler->override_option('header_empty', 0);
$handler->override_option('use_pager', '1');
$handler->override_option('path', 'members');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| page-table-view.png | 11.01 KB | dan.thompson | |
| view-settings.png | 67.9 KB | dan.thompson |
Comments
Comment #1
dawehneryou have base_table == 'node'
you have to create a view with viewtype user
Comment #2
dan.thompson commentedThanks. That did it.
Comment #3
seanberto commenteddid you ever figure this out? Having the same issue.
Comment #4
seanberto commentedJust found this: http://drupal.org/node/497936. Looks like you have to remove the underscore in the profile field machine-readable name.