When I add a views pane, the settings box that comes up after that has no options to set, just a Finish button. When the page displays, it's missing the display of the views pane because the arguments apparently aren't getting passed, and there is no options to set them either.

It works when I just add the view. Using the standard view and not a views pane, it displays options in the settings window, including ones to tell what to pass to the different arguments.

CommentFileSizeAuthor
#6 view_screenshot.png86.17 KBcgillogly
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

In the view configuration, there's a setting to control how it expects Panels to pass the arguments. What did you put there?

cgillogly’s picture

Opps... I guess it wouldn't show an option in there for my setup... Bad title for the issue

But, I have it setup as From Content, and the required context is Node ID... I'm using this for the node view override. I get nothing on the page where I have the view pane setup when I go to view the node.

cgillogly’s picture

I have the same issue with input on pane config. It is acting like it just isn't passing the arguments. If I set it to Fixed and enter a Node ID for a node, it displays the node.

cgillogly’s picture

The "From panel argument" is working... I select that and say first argument and it passes the argument and displays the node correctly... So, I'm assuming something related to the other types of argument methods... I will try to look at the code and see if I can find anything that might be causing it.

merlinofchaos’s picture

Hmm. I actually have the from context stuff working. From argument didn't actually work at all until recently (I had actually totally forgotten to even keep the argument stack for awhile) and I had context working well before it. It's possible I broke something more recently. I'll have to doublecheck that and see.

Note that if you have only one of a given context, and your pane requires that context, it *automatically* picks it up and does not present you with an input option. You only get an input option if there is more than one acceptable context to choose from.

cgillogly’s picture

FileSize
86.17 KB

I have attached a screen shot of the view I am using with my argument input settings showing as well. The view pane is going in the Node view (node/%node) override. As I said above, the "From panel argument" and Fixed are working for me, but not context or "input on pane config".

merlinofchaos’s picture

So as I was saying, if you have only one 'Node' context on the panel, you won't be presented with an input at all. It'll simply slot it and go. If there is > 1 then you'll be presented with an input to choose which one.

cgillogly’s picture

Yea, when I originally filed the bug, I wasn't thinking about that for some reason. So the actual problem is when I use the input on pane config or context for argument input settings, the arguments don't seem to be getting passed to the view pane or handled correctly. Nothing is displayed for the pane when I use those.

cgillogly’s picture

Title: Adding a Views Pane doesn't give options for arguments » Argument input via "input on pane config" or "context" doesn't seem to be working with views panes
cgillogly’s picture

OK, so when I add the view, not the view pane, to my panel and select what to pass for each argument in the settings in the panel from the context it works. But when adding the view pane and selecting the from context in the argument input area I get nothing. So, with view panes it doesn't seem to be passing the arguments along when using input on pane config or from context as I mentioned above. The problem only exists with using view panes.

Any ideas?

pdrake’s picture

I can confirm this issue. I have a views panel with argument input set to "Input on Pane Config". In my pane config, I am presented with a box to input my argument with the label that I gave it in the views panel. When I input a value there and click "Finish" the value is not saved (it does not re-appear there if I go back into the settings for that pane) and the view ignores the input value and takes it's argument from the URL (context?). Setting a fixed argument works (the fixed argument is used by the view).

zmove’s picture

I just confirm the #11 issue.

I have my view with Term ID as argument, if I try to put some argument in the view preview, it work as expected.

So I create a "Content Pane" view, and under pane option, I go to "Argument Input" > "Input on Pane config" > and it auto find that my argument is the Term Id and create the label automatically.

So then I go to my pane, I add the view in a pane. When I add it, it ask me for a Tid argument, so I put my argument here and click Finish. The view is added to the pane.

But when I go the live preview or to the panel page, no view appears (I put 404 error if argument is missing). If I change that to display the empty text if the argument is missing, the empty text appear in my pane live preview (So this is a missing argument issue).

If I edit the view (in the pane configuration) I confirm that the textfield that ask me the term id before is now empty, so I think the argument we put gere is not saved.

Here is a view export and a panel export, I hope it can help you to reproduce and debug.

$view = new view;
$view->name = 'produits';
$view->description = 'Listing des produits';
$view->tag = 'custom';
$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', 'Paramètres par défaut', 'default');
$handler->override_option('fields', array(
  'field_produit_image_fid' => array(
    'label' => '',
    '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,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'produit_tn_linked',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_produit_image_fid',
    'table' => 'node_data_field_produit_image',
    'field' => 'field_produit_image_fid',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => '',
    '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,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'body' => array(
    'label' => '',
    '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' => 1,
    'id' => 'body',
    'table' => 'node_revisions',
    'field' => 'body',
    'relationship' => 'none',
  ),
  'sell_price' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 1,
      'text' => '[body] <span class="price">[sell_price] TTC / Bouteille</span>',
      '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' => 'sell_price',
    'table' => 'uc_products',
    'field' => 'sell_price',
    'override' => array(
      'button' => 'Supplanter',
    ),
    'relationship' => 'none',
  ),
  'addtocartlink' => array(
    'label' => '',
    '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' => 1,
    'id' => 'addtocartlink',
    'table' => 'uc_products',
    'field' => 'addtocartlink',
    'override' => array(
      'button' => 'Supplanter',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'tid' => array(
    'default_action' => 'empty',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => '',
    'wildcard_substitution' => '',
    'title' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'taxonomy_term',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'set_breadcrumb' => 0,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
    ),
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'product' => 0,
      'panel' => 0,
      'page' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 1,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'status_extra' => array(
    'operator' => '=',
    'value' => '',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status_extra',
    'table' => 'node',
    'field' => 'status_extra',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'product' => 'product',
    ),
    '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('title', 'Nos vins du Jura');
$handler->override_option('header_format', '2');
$handler->override_option('header_empty', 0);
$handler->override_option('empty', 'Aucun produit ne correspond à vos critères de recherche.');
$handler->override_option('empty_format', '2');
$handler->override_option('items_per_page', 0);
$handler->override_option('distinct', 0);
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
$handler->override_option('row_options', array(
  'inline' => array(),
  'separator' => '',
));
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->override_option('pane_title', '');
$handler->override_option('pane_description', '');
$handler->override_option('pane_category', array(
  'name' => 'View panes',
  'weight' => '0',
));
$handler->override_option('allow', array(
  'use_pager' => 0,
  'items_per_page' => 0,
  'offset' => 0,
  'link_to_view' => 0,
  'more_link' => 0,
  'path_override' => 'path_override',
  'title_override' => 'title_override',
  'exposed_form' => FALSE,
));
$handler->override_option('argument_input', array(
  'tid' => array(
    'type' => 'user',
    'context' => 'node.uid',
    'panel' => '0',
    'fixed' => '',
    'label' => 'Taxonomie: Term ID',
  ),
));
$handler->override_option('link_to_view', 0);
$handler->override_option('inherit_panels_path', '0');

And here is the panel export :

$page = new stdClass;
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'vins_du_jura';
$page->task = 'panel_page';
$page->admin_title = 'Vins du Jura';
$page->path = 'vins-du-jura';
$page->access = array(
  'logic' => 'and',
);
$page->multiple = FALSE;
$page->menu = array(
  'type' => 'none',
  'title' => '',
  'name' => 'navigation',
  'weight' => '0',
  'parent' => array(
    'type' => 'none',
    'title' => '',
    'name' => 'navigation',
    'weight' => '0',
  ),
);
$page->arguments = array();
$page->conf = array(
  'no_blocks' => 0,
  'css_id' => '',
  'css' => '',
  'contexts' => array(),
  'relationships' => array(),
);
$display = new panels_display;
$display->layout = 'twocol';
$display->layout_settings = array();
$display->panel_settings = array();
$display->cache = array();
$display->title = '';
$display->hide_title = FALSE;
$display->content = array();
$display->panels = array();
  $pane = new stdClass;
  $pane->pid = 'new-1';
  $pane->panel = 'left';
  $pane->type = 'views_panes';
  $pane->subtype = 'produits-panel_pane_1';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array(
    'path' => '',
    'override_title' => 0,
    'override_title_text' => '',
  );
  $pane->cache = array();
  $pane->style = array();
  $pane->css = array();
  $pane->extras = array();
  $pane->position = 0;
  $display->content['new-1'] = $pane;
  $display->panels['left'][0] = 'new-1';
$page->conf['display'] = $display;
bsuttis’s picture

Confirming issue, http://drupal.org/node/451078#comment-1563546 explains it clearly.

moonray’s picture

Same issue here.
I have the view output the argument via drupal_set_message(). With "from panel argument" I get the expected output, but with "input on pane config" or "context" there is no output, which means there is no argument.

moonray’s picture

I've tracked down part of the problem to ctools/views_content/plugins/content_types/views_panes.inc
The function views_content_views_panes_content_type_render expects the $contexts argument to be a keyed array, but it's not keyed.

It's either of two problems:
a) $contexts is correct (it should not be keyed) in which case the function's code needs updating.
b) $contexts is not correct, and the problem is farther upstream

If b) is the case, I'm not sure where that farther upstream is. Hopefully this gives someone with more insight into the panels (or ctools) module a place to start.

moonray’s picture

Status: Active » Needs review

Some more delving reveals that the function _views_content_panes_content_type() is where the contexts array is created. Unkeyed.

So, the solution seems to be to change line 150 in ctools/views_content/plugins/content_types/views_panes.inc from:

        if ($key) {

to:

        if ($contexts[$key]) {
merlinofchaos’s picture

Status: Needs review » Fixed

Well, you're both right and wrong. Your ultimately right, but all arrays in PHP are keyed, and it's pulling the keys right out of the array.

What's *wrong* is that the first key is 0, and if ($key) fails when it is 0. So your solution more or less works. I added an isset to make it notice safe. And I checked in a fix.

For those who want to fix it right away, you can use the change moonray mentioned in #16.

merlinofchaos’s picture

Additionally, the "input on pane config" problem is fixed here: http://drupal.org/node/467198

moonray’s picture

Status: Fixed » Needs review

merlinofchaos: you didn't quite fix this issue. You seem to have an 's' missing:

current "fixed" code in views_panes.inc line 155:

        if (isset($context[$key])) {

should be:

        if (isset($contexts[$key])) {
merlinofchaos’s picture

Status: Needs review » Fixed

Well that was a bad typo. Ugh. Committed. Thanks for the catch!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.