Panels / Views compatability issue?
| Project: | Fivestar |
| Version: | 6.x-1.18 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | Fivestar, fivestar.module, fivestar_vote, Missing argument 4, panels, views |
I am working on a project that aggregates several pieces of contextual information using Panels (3.x). Using the node id as an URL argument, panels loads the appropriate node body, attachments, comments, blocks, and user information into a single page. However, I appear to have an issue: 1. embedding the out-of-box fivestar block, and 2. a promising Views 2 workaround.
1. Fivestar Block
It appears the block that comes with this module is not compatible with Panels. I can embed that block within Panels, but when viewing the rendered page, it's just an empty whitespace.
2. View 2 Work around
I got sneaky and built a View that A) accepts a node id as a parameter, B) creates a relationship with the node: vote results, C) Displays the result as an unformatted field. D) Renders fivestar using the "clickable, with text" appearance.
I go back to my panel, configure it to use this view and it works!!! Sort of... it displays my fivestar in panels, BUT I cannot vote. It's interactive and let's me *try* to vote, but it perpetually says, "Saving your vote..." and when I click out of that page I get this error:
warning: Missing argument 4 for fivestar_vote() in /hsphere/local/home/yadadrop/yadadrop.com/sites/all/modules/fivestar/fivestar.module on line 688.
Summary:
If I am going about putting fivestar into Panels the wrong way, I would appreciate some guidance. However, if fivestar (clickable, with text) is not presently compatible with Panels and/or Views, I am placing my vote to add this feature.
Peace,
Brian

#1
An export of my view for a "Screencast" node type. Screenshot attached too.
$view = new view;$view->name = 'screencast_detail';
$view->description = 'screencast detail';
$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', 'Defaults', 'default');
$handler->override_option('relationships', array(
'votingapi_cache' => array(
'label' => 'Vote results',
'required' => 0,
'votingapi' => array(
'value_type' => '',
'tag' => '',
'function' => 'average',
),
'id' => 'votingapi_cache',
'table' => 'node',
'field' => 'votingapi_cache',
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'value' => array(
'label' => 'Value',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'set_precision' => 0,
'precision' => '0',
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'appearance' => 'fivestar_views_widget_normal_handler',
'exclude' => 0,
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache',
),
));
$handler->override_option('arguments', array(
'nid' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'nid',
'table' => 'node',
'field' => 'nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'image' => 0,
'panel' => 0,
'page' => 0,
'screencast' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
),
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'screencast' => 'screencast',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 0);
$handler->override_option('style_options', array(
'grouping' => '',
));
$handler->override_option('row_options', array(
'inline' => array(
'value' => 'value',
),
'separator' => '',
));
#2
There is definitely an issue with panels. Overriding the nodetemplate with panels still works when the node has a fivestar widget attached but I cannot get it to show in the panel display. All the rest of the node is displayed properly only the fivestar stuff is "stripped".
My uneducated guess would be that this is some issue that has to be solved within panels. I raise the prority to catch the attention of someone deeper knowledge. Maybe this issue has to be moved into the panels queue......
#3
We have the same issue - any updates? thanks.
#4
Subscribe.
#5