Hello,

I want to insert a View panel pane on Panel page with an argument (by date: year).
The Live Previews of my panel pane is good but is not displaying with the argument in the panel page.
In "configure my_view: panel page, I select "send arguments" (Do I?), Argument: 2008 (year).

Do I have to configure something in the View Panel settings ?

When I click "more" in the panel page, the display of my view page is good, the argument i put in "configure my_view: Argument: 2008 (year) is working...

Do i miss something?

Thanks to helping me, and thanks for this beautiful modules! ^^

Julien

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Junro’s picture

Hi, this bug is going to be fixe soon?
This bug has been report before? Someone is working on it?

brahms’s picture

Status: Active » Needs review
FileSize
503 bytes
503 bytes

I had the same problem and it seems that the call of the views member function preview $block->content = $view->preview(); in line 167 of panels_views.module is the reason for the error. Looking at this member function in views module (in version 6.x-2.0-rc3) which has two parameters:

view::preview($display_id = NULL, $args = array())

I see that if the second paramater $args is not specified, then no argument is used for building the view's output. So I changed line 167from $block->content = $view->preview(); to $block->content = $view->preview(NULL, $args); and now the arguments are working.

I attach two patch files with this modification, one is for panels 6.x-2.0-alpha1 and the other is for panels 6.x-2.0-dev from 22008-Sep-20. To apply this patch please copy the appropriate patch file into your site's contributed module directory (path should be something like [path-to-your-site]/sites/all/modules ) and start patching with patch -p0 < filename

littleneo’s picture

THANKS A LOT !!!

now views with argument are displayed in panels view (with the same arguments) as expected !

ps : how do you explain that when adding some CCK-blocks in a panel which has an argument like nodeID context, that will work directly, without having to configure arguments for them ? it worked even without this patch.

ps² : where can I find informations about arguments setup in panels ? I mean precise informations about the way panels give arguments to views. (the windows that popups when adding a view with argument)

brahms’s picture

Category: support » bug

Just changed the category to bug report.

littleneo’s picture

there's a another

$block->content = $view->preview();

line in panels_views.module.

fatro’s picture

Patch worked!

but what's about another

$block->content = $view->preview();

on line 476?

littleneo’s picture

in fact it was just a remark, I don't know exactly how Drupal and panel are made.
but it has been also updated in the dev build I've downloaded today. so I would say yes.

it solves the issue in alpha but the issue came back for me in dev ! I mean the same symptoms :

when adding a view that needs arguments to a panel with a node context, it won't show up the context related view.

sidharth_k’s picture

@brahms thanks for the patch!! I had already spent one whole day on this...thinking that I had done something wrong.

There is another related issue after applying your patch to the October 9 dev version:

I don't see the titles of the view! (after adding the view pane). I have to "Hack it" by explicitly putting something in the "override title" in the view pane....This should not happen right?

Thanks,

Sidharth

webstylemedia’s picture

Thanks for patch!

GUYS PLEASE ADD THIS TO CORE URGENTLY!

Spent 2 days trying to find out what's going wrong with arguments!

Thanks.

brahms’s picture

@merlinofchaos

Looking at the code in panels_views.module I'm not shure if the reason for the problem discussed in this issue is a problem of panels or one of the views API. In function panels_views_all_views_render() which renders the view I see first that the arguments for the view are set in:

$view->set_arguments($args);

Later I find the original call to the view member function view::preview in the code:

$block->content = $view->preview()

First I expected that $block->content = $view->preview() would use the arguments given in $view->set_arguments($args);. But this is not the case as in view::preview there is another call $this->set_arguments($args); which sets the arguments. And they are set to NULL here because panels_view.module calls $block->content = $view->preview() with no arguments.

Maybe this is an errror in panels code which can be fixed with $block->content = $view->preview(NULL, $args) as I described in comment#2?

But on the other hand it could be also an error in view::preview, which could also respect any previously set arguments in this->args, if it's called without any $args parameter?

sidharth_k’s picture

The problem still exists in alpha2 :-(

Aldus’s picture

WONDERFUL!!! Worked like a charm... I patched the alpha 2 version, so the patch is good for that as well.
Great work... I hope this will be fixed in next version.

webstylemedia’s picture

Guys, are you stupid?

Again in new alpha and new beta no this fix.

I upgraded my module and got into the same error again.

But I didn't verified it on live site and my site has a probs for a two days until one of visitors didn't reported about problem that all my panels looks same for every content type from views.

PLEASE ADD THIS PATCH URGENT!!!!!!!!!!

Thanks.

Dmitry

sidharth_k’s picture

@webstylemedia: I share your frustrations with the state of Panel 2 in D6 but it would be unfair to use words like "stupid" -- most of the people work on these projects in their spare time so they really *don't* owe us anything.

To all the Panel maintainers, I would like to request that this module be sorted out as soon as it is possible. There is a momentum building up in D6 with Views, CCK, imagefield etc. all sorta getting "done." I'm not a real expert on layouts so Panels is *critical* to me. Would it be possible to get Panels 2 resolved in D6 soon? Its holding widespread adoption of D6 back...at least for newbies like me.

There hasn't been much activity on Panels 2 for the last 8 days since alpha2 came out...Can you guys really really sort this out?

We need the triumvirate of Views/CCK/Panels to be done in D6 so that people can finally start abandoning the now clunky feeling D5. Thanks.

dmower’s picture

Status: Needs review » Reviewed & tested by the community

I've confirmed that this patch does indeed solve the issue, and is still missing from the latest released alpha.

The line that needs to be patched is line 167 however, not 164 anymore. The same fix applies though.

KrisBulman’s picture

please add this patch

dmower’s picture

Version: 6.x-2.0-alpha1 » 6.x-2.0-alpha2
Priority: Normal » Critical

Just noticed this should be marked as alpha2 not alpha1 since the bug still exists.

I was going to change it to 6.x-2.x-dev but that loks to be older than the alpha2.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Active

webstylemedia: You're running an *alpha* version of code on a live site and you call US stupid? If you're running panels alpha on a live site with visitors, you deserve everything you get. You are not welcome in this issue queue.

To the rest of you: There's a reason we released this with the alpha tag. I apologize but I'm really busy with another very large module, plus personal stuff, and Panels has been a much lower priority for me. That's why this is alpha. Sorry about the time it takes, but that's just the way it is.

Brahms: Thanks for figuring out what the problem is. That means that this is a bug in Views, since the NULL args shouldn't override the previously set args. I'll fix it over there. In the meantime, this patch can be used as a workaround to keep you going.

I'm going to mark this won't fix since it's a Views issue, but I"ll leave it active until Views actually has it fixed so it's easier to find.

brahms’s picture

@merlinofchaos:

Thanks for your response to my question in my comment#10 above. This confirms my assumption that the problem lies on views side (which is perfect in this case as you are the inventor and maintainer of both of this excellent modules. BTW: many thanks to you and all the other views and panels developers for contributing those really must have modules to us all).

merlinofchaos’s picture

I just committed the fix to Views, so the next Views -dev to be generated will also fix this. I'm not sure when I'll release Views 2.2 so either this patch or Views -dev are the proper fixes here.

brahms’s picture

Thank you for the quick bugfix and congratulations for beeing one of the first annual Open Source CMS MVPs - you really deserve it!

Psycnic’s picture

Not to rush anyone(I understand what goes into developing modules, or at least partly), but when will panels for 6.x be be officially released. I was using 5.x, but was eventually persuaded into using 6.x(great move for the most part). My site will be going live in a month or so, so I was really hoping I'd be able to use 6, but if panels doesn't come through I'm going to have to revert back to 5.

And congrats to you merlin, never would have been able to achieve what I have already without your modules & support in the forums!

TheRec’s picture

Subscribing.

I am wondering is if there is any documentation in the work for passing arguments from panels to views because there are a lots of possible "combinations", it is not perfectly clear, at least to me, how it should be configured.

The way I thought it would work :

  1. Create a View and give it a Panel pane display which will have an Argument, in my case a taxonomy term.
  2. Create a Panel page, with an URL (i.e. blog) without any %
  3. In the Context tab, add an argument (taxonomy term again) which was supposed to be the same as the one I set in my View previously.
  4. In the Content tab, add the Panel pane.

But it doesn't work, the view indeed shows up but the parameters have no effect, I can only see the view, it show the right datas "unfiltered", but if I add the argument in the URL then it shows again all the nodes... and if I use a wrong argument it shows also all the nodes, despit I set in the View that a wrong argument should show a 404 error. That was with latest Views stable (2.1).

I also tested with with the latest -dev (last commit #307287) of Views and latest -dev of Panels from today, but with the same configuration (tried to recreate all and empty cache and views cache of course) the panel pane doesn't show up, althought other panes (menus, custom content) are working on the same panel though.

** EDIT **
It seems that the following settings are working (with latests -dev) : In the view, "Argument input" set to "From panel argument" and set the position for the argument(s)... no argument set in the panel. Hope this helps ;)

Only thing that I didn't get working is the title of the view. If I set one for the Panel pane, it shows up on the top of the Panel pane as it should but in the "Arguments" of the View it is possible to set a specific title (with %1 substitution) that should be displayed when the argument is used (I am talking about a Taxonomy argument in this case) and this custom title seems ignored by the panel. My goal is to display "Articles by tag : ...", but it always displays "Articles" which is the title set in the view.
This custom title works fine when I set an argument and I display the view as a feed or a page, so I think the problem is related to Panels maybe.

sdboyer’s picture

Status: Active » Fixed

@picnic - First, please do note that this is off topic for the issue. Short version: it's impossible for me to give you a clear answer for MANY reasons. Several other people have asked the same question, and we've given answers of sorts. There are a few major issue areas we're slogging through right now, though, that make me feel particularly incapable of answering the question in any meaningful way.

Marking as fixed.

drjonez’s picture

Wait so what ? How do I fix this. I have the Dev version (because of another bug that was happening)

I guess I'll slosh through

drjonez’s picture

Version: 6.x-2.0-alpha2 » 6.x-2.x-dev

I am using 6.x-2.x-dev and ARGS are not being passed to VIEWS from MINI-PANELS

Arg (lol)

drjonez’s picture

Okay I applied the patch in #2 and it looks like ARGS are passing.

thanks for all your help when will this be put into core?

jyg’s picture

sho' nuff! Thanks you Brahms!

alexpott’s picture

I've been investigating this further today and made a few discoveries to share...

The call to $view->set_arguments($args); in panels_views_all_views_render seems to be superflous as it is done in preview.

Also to call preview in the most efficient way it should be:

  $block->content = $view->preview($display, $args); 

Additionally I was wondering why the preview view function and not the execute_display function? However when I change the function it does not work for two reasons:

  • The inital check of display argument is different from preview and regardless of the value passed in it would always call $this->set_display($display_id) - However this is a view bug show I should report this there :)
  • And some other I haven't quite worked out yet :)

Additionally I get a further PHP error on the following part of panels_views_all_views_render function

  foreach ($panel_args as $id => $arg) {
    $args = str_replace("@$id", $arg, $args);
  }

Because by this stage one of my panel arguments is the full node from nid being passed in so the get this php error:

recoverable fatal error: Object of class stdClass could not be converted to string in ...\sites\all\modules\panels\panels_views\panels_views.module on line xxx.

Are panel arguments supposed to having complete node objects in them?

I hope this helps - panels and views are amazing and Merlinofchaos definitely deserves the MVP award!

dorien’s picture

Version: 6.x-2.x-dev » 6.x-2.0-alpha2

Same thing here.

If I insert a views block, I get:

recoverable fatal error: Object of class stdClass could not be converted to string in xxx/sites/all/modules/panels/panels_views/panels_views.module on line 124.

As merlinofchaos suggested in this post (http://drupal.org/node/307628), I commented out the lines 124-126 and the error went away:

Ok, the problem right now is that Panels isn't preserving the arguments that panels_views expects. The line causing this error can probably be safely commented out. It means that using @0 in the 'args' textfield in the pane configuration will not work, but I imagine that's not as much in use right now. (Using %0 I believe should continue to work as that pulls from arg()).

This one will take us awhile to fix. The D6 menu system really threw wrenches into this.

Thanks for the magnificent work you guys!

dorien’s picture

Using the patch in #2, panels works great with a single argument. However. I just defined a relationship users based on node id with panels. The views panel pane has argument user: uid and the panel pane argument is from context user.
The query is good and so is the life preview.
But the empty text appears on the real panel, so I am guessing that this has something to do with the fact that it is a relationship based argument?

Thanks in advance!!!

***************
UPDATE: I can get around this by adding a views block to the panel instead of a panel page.

Status: Fixed » Closed (fixed)

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

webstylemedia’s picture

merlinofchaos: yes we use panels on live site. guys it's already drupal 6.8 released. all modules - views, cck released for d6. I MUST use Panels because there are no alternative. Btw, in last beta - (downloaded today) still no this patch included.

cgjohnson’s picture

I had the same problem (using latest stable versions of both), but was able to fix it by adding %1 to each panes' configuration in the panel page. After that, it shows the filtered nodes. Very cool, these modules together.

So in short, my goal: use a panel page to override the typical taxonomy/term pages, so I could style all in one place.

Steps:
- create the views panel panes with a term TID argument
- create a panel page using the URL base (no%)
- in my panel page, add panes to the content area, making sure to specify the argument %1 in the pane argument field.

I hope this helps someone.

Junro’s picture

Status: Closed (fixed) » Active
musko’s picture

Version: 6.x-2.0-alpha2 » 6.x-3.0-beta2
Component: Panel pages » Views panes

Could you be a little more clear on that cgjohnson? I'm having the same issue with the latest beta's of both ctools + panels.

Seems this has gone unfixed for a very long time. Arguments in a pane are almost crucial for me. And it's only in a PANE that this issue exists!

merlinofchaos’s picture

merlinofchaos: yes we use panels on live site. guys it's already drupal 6.8 released. all modules - views, cck released for d6. I MUST use Panels because there are no alternative. Btw, in last beta - (downloaded today) still no this patch included.

Go away. You get this software for free. You have absolutely no authority over me, my time, or my software.

As for the rest of you who are having problems, I see lots of "I'm having the same problem" but nobody is providing a simple set of instructions to replicate the issue. That's the reason "this" has gone unfixed. Please, if you are experiencing a problem, it is vital that you reduce it to the simplest components and provide instructions to replicate. Otherwise it is very difficult to work on it.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
cgjohnson’s picture

Hi Musko, what do you want to know in particular? Are you using a panel page? In each content box that you add, you need to specify the argument for each pane -- in my case I used %1, because I only had 1 argument in Views (Term TID). Here's what I did:

Create a View with the argument(s) you want, I used Taxonomy Term TID as my argument. I then added Panel Pane displays, and used filters to get nodes of a certain type within each taxonomy term. Then, use the Views Preview function at the bottom of the Views edit area to test it out to make sure the argument and filters are working. (Enter a taxonomy TID and click preview and it should work). If they're working, you can make your panel pages work.

I created a panel page. I didn't add a context overall. On the Content tab, I added the Panes from my view and left Send Arguments unchecked, but added %1 in the argument field.

In my case, I was creating a panel to replace the default taxonomy page view, so my panels page has the URL of "taxonomy" (no " and no /) and my view has taxonomy/%.

The panes are now automatically filtered to show only nodes in that taxonomy.

does that help?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No updates for more than 30 days.