the following view field does not return a value: Userpoints: Userpoints Category Category

CommentFileSizeAuthor
#5 points_category.txt3.56 KBsoulfroys

Comments

socialnicheguru’s picture

using node view.

socialnicheguru’s picture

Title: Userpoints: Userpoints Category Category returns blank value » Userpoints: Userpoints Category Category and userpoints transaction categories returns blank value
Issue tags: +userpoints transaction category, +userpoints;userpoints terms

Here is an example view

$view = new view;
$view->name = 'userpoint_test';
$view->description = 'Userpoints views error- for each point in a category (tid) the results are repeated.';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'users';
$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('relationships', array(
'uid' => array(
'id' => 'uid',
'table' => 'userpoints',
'field' => 'uid',
),
));
$handler->override_option('fields', array(
'name' => array(
'label' => 'Name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_user' => 1,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'none',
),
'points_1' => array(
'label' => 'Points',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 1,
'empty_zero' => 0,
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
'id' => 'points_1',
'table' => 'userpoints_txn',
'field' => 'points',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'description' => array(
'id' => 'description',
'table' => 'userpoints_txn',
'field' => 'description',
),
'entity_type' => array(
'id' => 'entity_type',
'table' => 'userpoints_txn',
'field' => 'entity_type',
),
'operation' => array(
'id' => 'operation',
'table' => 'userpoints_txn',
'field' => 'operation',
),
'reference' => array(
'id' => 'reference',
'table' => 'userpoints_txn',
'field' => 'reference',
),
'status' => array(
'label' => 'Status',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 1,
'empty_zero' => 0,
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
'id' => 'status',
'table' => 'userpoints_txn',
'field' => 'status',
'relationship' => 'none',
),
'time_stamp' => array(
'id' => 'time_stamp',
'table' => 'userpoints_txn',
'field' => 'time_stamp',
),
'tid_1' => array(
'id' => 'tid_1',
'table' => 'userpoints_txn',
'field' => 'tid',
),
'phpcode' => array(
'label' => 'Timestamp',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '

print $data->userpoints_txn_time_stamp;

',
'sortable' => '1',
'exclude' => 1,
'id' => 'phpcode',
'table' => 'customfield',
'field' => 'phpcode',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'uid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'user',
'default_argument' => '',
'validate_type' => 'me',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'uid',
'table' => 'users',
'field' => 'uid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'6' => 0,
'3' => 0,
'4' => 0,
'5' => 0,
'7' => 0,
'8' => 0,
'14' => 0,
'9' => 0,
'13' => 0,
'10' => 0,
'11' => 0,
'12' => 0,
),
'me_redirect' => 1,
'me_validate_user_argument_type' => 'either',
'me_validate_user_roles' => array(
'2' => 0,
'6' => 0,
'3' => 0,
'4' => 0,
'5' => 0,
'7' => 0,
'8' => 0,
'14' => 0,
'9' => 0,
'13' => 0,
'10' => 0,
'11' => 0,
'12' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '',
'validate_argument_node_type' => array(
'poll' => 0,
'blog' => 0,
'book' => 0,
'group' => 0,
'shoutbox' => 0,
'feed_fast' => 0,
'feed' => 0,
'feed_item' => 0,
'live_event' => 0,
'socialnicheguru_event_feed' => 0,
'socialnicheguru_makemeeting' => 0,
'socialnicheguru_todo' => 0,
'socialnicheguru_todo_project' => 0,
'chatroom' => 0,
'chat' => 0,
'product' => 0,
'socialnicheguru_conference_room' => 0,
'socialnicheguru_event' => 0,
'socialnicheguru_booking' => 0,
'socialnicheguru_role_product' => 0,
'socialnicheguru_role_product2' => 0,
'uc_recurring_subscription' => 0,
'audio' => 0,
'v2wvc' => 0,
'panel' => 0,
'activitystream' => 0,
'graphmind' => 0,
'mass_contact' => 0,
'simplenews' => 0,
'socialnicheguru_location' => 0,
'socialnicheguru_profile' => 0,
'socialnicheguru_profile_career' => 0,
'socialnicheguru_profile_edu' => 0,
'socialnicheguru_profile_interest' => 0,
'socialnicheguru_profile_service' => 0,
'socialnicheguru_todo_project_grp' => 0,
'socialnicheguru_video' => 0,
'socialnicheguru_video_comment' => 0,
'topichub' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'158' => 0,
'159' => 0,
'298' => 0,
'338' => 0,
'143' => 0,
'160' => 0,
'299' => 0,
'300' => 0,
'301' => 0,
'302' => 0,
'303' => 0,
'154' => 0,
'304' => 0,
'305' => 0,
'153' => 0,
'156' => 0,
'152' => 0,
'339' => 0,
'306' => 0,
'307' => 0,
'150' => 0,
'308' => 0,
'149' => 0,
'148' => 0,
'147' => 0,
'146' => 0,
'210' => 0,
'309' => 0,
'137' => 0,
'204' => 0,
'341' => 0,
'206' => 0,
'343' => 0,
'205' => 0,
'342' => 0,
'203' => 0,
'340' => 0,
'1' => 0,
'310' => 0,
'311' => 0,
'312' => 0,
'313' => 0,
'314' => 0,
'315' => 0,
'316' => 0,
'317' => 0,
'231' => 0,
'296' => 0,
'207' => 0,
'318' => 0,
'319' => 0,
'138' => 0,
'320' => 0,
'145' => 0,
'321' => 0,
'144' => 0,
'322' => 0,
'323' => 0,
'324' => 0,
'325' => 0,
'326' => 0,
'327' => 0,
'328' => 0,
'329' => 0,
'142' => 0,
'4' => 0,
'337' => 0,
'141' => 0,
'330' => 0,
'331' => 0,
'332' => 0,
'333' => 0,
'140' => 0,
'334' => 0,
'335' => 0,
'155' => 0,
'157' => 0,
'336' => 0,
'2' => 0,
'211' => 0,
'139' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_is_member' => 'OG_VIEWS_DO_NOT_VALIDATE_MEMBERSHIP',
'validate_argument_group_node_type' => array(
'group' => 0,
),
'validate_argument_signup_status' => 'any',
'validate_argument_signup_node_access' => 0,
'validate_argument_node_flag_name' => '*relationship*',
'validate_argument_node_flag_test' => 'flaggable',
'validate_argument_node_flag_id_type' => 'id',
'validate_argument_user_flag_name' => '*relationship*',
'validate_argument_user_flag_test' => 'flaggable',
'validate_argument_user_flag_id_type' => 'id',
'validate_argument_php' => '',
'me_validate_user_restrict_roles' => 0,
'override' => array(
'button' => 'Override',
),
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('footer_format', '4');
$handler->override_option('footer_empty', 0);
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => 'time_stamp',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'name' => 'name',
'points_1' => 'points_1',
'description' => 'description',
'entity_type' => 'entity_type',
'operation' => 'operation',
'reference' => 'reference',
'status' => 'status',
'time_stamp' => 'time_stamp',
'tid_1' => 'tid_1',
'phpcode' => 'phpcode',
),
'info' => array(
'name' => array(
'sortable' => 0,
'separator' => '',
),
'points_1' => array(
'sortable' => 1,
'separator' => '',
),
'description' => array(
'separator' => '',
),
'entity_type' => array(
'separator' => '',
),
'operation' => array(
'separator' => '',
),
'reference' => array(
'separator' => '',
),
'status' => array(
'separator' => '',
),
'time_stamp' => array(
'separator' => '',
),
'tid_1' => array(
'separator' => '',
),
'phpcode' => array(
'sortable' => 0,
'separator' => '',
),
),
'default' => 'points_1',
));

soulfroys’s picture

Same problem here... even with node:

$view = new view;
$view->name = 'Pontos_total_teste';
$view->description = '';
$view->tag = '';
$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', 'Formato inicial (padrão)', 'default');
$handler->override_option('fields', array(
  'points' => array(
    'label' => 'Points',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 0,
    'id' => 'points',
    'table' => 'userpoints',
    'field' => 'points',
    'relationship' => 'none',
  ),
  'tid' => array(
    'label' => 'Userpoints Category',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'type' => 'ul',
    'separator' => ', ',
    'link_to_taxonomy' => 0,
    'limit' => 1,
    'vids' => array(
      '14' => 14,
      '1' => 0,
      '7' => 0,
      '12' => 0,
      '13' => 0,
    ),
    'exclude' => 0,
    'id' => 'tid',
    'table' => 'userpoints',
    'field' => 'tid',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('items_per_page', 50);
$handler->override_option('style_plugin', 'table');
soulfroys’s picture

Priority: Normal » Major

Even this simple view do not show category properly, any help? I using:
Drupal 6.14,
Views 6.x-2.11 and
Userpoints 6.x-1.x-dev (2011-01-02).
I move it to "major", since category it's a very important feature (did I make a right move?)

$view = new view;
$view->name = 'Pontos_categoria';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'userpoints';
$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', 'Formato inicial (padrão)', 'default');
$handler->override_option('fields', array(
  'last_update' => array(
    'label' => 'Last update',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'date_format' => 'small',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'last_update',
    'table' => 'userpoints',
    'field' => 'last_update',
    'relationship' => 'none',
  ),
  'max_points' => array(
    'label' => 'Max pontos',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 0,
    'id' => 'max_points',
    'table' => 'userpoints',
    'field' => 'max_points',
    'relationship' => 'none',
  ),
  'points' => array(
    'label' => 'Pontos',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 0,
    'id' => 'points',
    'table' => 'userpoints',
    'field' => 'points',
    'relationship' => 'none',
  ),
  'tid' => array(
    'label' => 'Userpoints Category',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'type' => 'separator',
    'separator' => ', ',
    'link_to_taxonomy' => 0,
    'limit' => 1,
    'vids' => array(
      '14' => 14,
      '1' => 0,
      '7' => 0,
      '12' => 0,
      '13' => 0,
    ),
    'exclude' => 0,
    'id' => 'tid',
    'table' => 'userpoints',
    'field' => 'tid',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'last_update' => 'last_update',
    'max_points' => 'max_points',
    'points' => 'points',
    'tid' => 'tid',
  ),
  'info' => array(
    'last_update' => array(
      'separator' => '',
    ),
    'max_points' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'points' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'tid' => array(
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
soulfroys’s picture

StatusFileSize
new3.56 KB

Same problem with fresh Drupal 6.20 and userpoints/views last dev...

SELECT userpoints.uid        AS uid,
       users_userpoints.name AS users_userpoints_name,
       users_userpoints.uid  AS users_userpoints_uid,
       userpoints.points     AS userpoints_points
FROM   userpoints userpoints
       INNER JOIN users users_userpoints
         ON userpoints.uid = users_userpoints.uid 
berdir’s picture

Status: Active » Closed (duplicate)

See #871126: Fix Bugs in Views Integration. Looks like I will have to backport the patch there.