View titles with arguments incorrectly displayed in panel page

laken - April 27, 2009 - 17:29
Project:Panels
Version:5.x-2.0-rc1a
Component:Panel pages
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:arguments, panels, Panels2, title, view, View title
Description

(I thought I had seen this in a previous issue but I'm unable to turn it up with search - if this is a dup kindly point me to the proper issue.)

I'm embedding a view in a panel page. The view accepts 2 arguments: "Node: Posted Year", and "Node: Posted Month". Defaults for both arguments are set to "Summary, sorted ascending". Argument title for argument 1 is "Archive for %1" and argument title for argument 2 is "Archive for %2, %1".

When the view is accessed directly via its URL (not through a panel page), the view titles display perfectly. For the simple path "/archive" (no arguments present) I just get the title "Archive" which is set in the page title field. For a path like "archive/2009" I get the title "Archive for 2009", and for a path like "archive/2009/1" I get the title "Archive for January, 2009". Nice.

However, when the view is embedded in a panel page, when no argument is present I get the title "Archive for %2, %1". When the year argument only is present I get "Archive for %2, 2009". When both year and month args are present it does correctly display "Archive for January, 2009"

So it seems that panels is not correctly passing through Views' intelligent handling of the view title depending on whether arguments are present or not. I can't have those literal "%1" and "%2" in my titles. Is there a known solution for this?

In a separate issue, I want the title of this view to be the title of the panel page. But since the year/month arguments here are directly from the URL and aren't configured in the Context tab, I'm not sure how to tell the panel page that this pane title should be the page title.

#1

laken - May 2, 2009 - 01:58

bump: I haven't found any resolution for this yet. If there's any more information I need to provide please let me know.

Many thanks!

#2

laken - May 12, 2009 - 23:53

Still found no fix for this - bumping one more time before I call Sam on his cell at 3 AM in the middle of finals week ;-)

#3

sdboyer - May 13, 2009 - 05:21

Crucial piece of info I'm missing here: is the view being embedded directly (i.e., through panels_views_legacy) or through the intermediary panels_views configuration? I'm imagining it's the former - in which case the first & fastest thing to do will be to re-generate that view in panels_views, then see if the problem is solved there. (Generally speaking, panels_views is less buggy than panels_views_legacy).

Lemme know about that and I'll make more progress.

#4

laken - May 14, 2009 - 05:56

Shoot, I'm not subscribed to this thread...

We're doing everything through panels_views configuration - panels_views_legacy module is disabled and we never use it.

#5

laken - May 14, 2009 - 16:21

One more data point that may be relevant (though I doubt it) - I have this patch applied: http://drupal.org/node/213751

#6

sdboyer - May 21, 2009 - 05:43

OK, so (finally) taking some time on this. Sorry for the delay. Basically, it looks like some inconsistencies in how views_get_title() is behaving, which no doubt has to do with the way the view gets built in panels_views.module. Specifics, though, aren't possible without a good test environment. And I'm realizing that what would actually take me by FAR the most time here is setting up that test environment that really replicates the exact situation. So I have a proposal - either:

1) You do a var_dump() or dsm() or whatever inside of the views_get_title() function (circa line 730 of views.module) on all three of the parameters that're being passed in. Then, provide me output of those vars for all six of the cases you've described - {page,embedded} view with {0,1,2} arguments. Do it at the very start of the function, please, before they've been changed at all.

2) Just provide me a db dump and the source tree so I can quickly set up and tear down over here. I'll destroy it immediately after solving the problem. The advantage of knowing me, and knowing you can send things to me securely, I guess? :)

Really, the second solution would be easiest, and probably require the least time from both of us, but either or both are welcome.

#7

laken - May 21, 2009 - 20:06

Thanks, sent you the db dump and source tree via email.

#8

sdboyer - May 26, 2009 - 04:55

Heh, yup. Lookie there, that was an annoying little sucker. views_get_title() was being passed an array of nulls for the arguments, since the argument builder wasn't behaving properly if no panel args were passed in (basically, it was always assuming they'd be there). Fix commited, but I've attached a patchfile here, too, given..ahem...how long it's been since there's been a Panels 5.x release :)

AttachmentSize
pv_title.patch 607 bytes

#9

laken - June 10, 2009 - 23:52

Sorry for the delayed reply - I've been on vacation. Thanks for finding and fixing this! I updated my local sandbox to latest 5.x-2.x-dev and it seems to work great.

I'm wondering if I should update my production instance with the latest dev or just install the patch? I just reviewed the changed and it seems that most are in panels_page.admin.inc and panels_page.module. My former versions for these are

panels_page.admin.inc,v 1.1.2.52 2008/08/17
panels_page.module,v 1.1.2.73 2008/08/21

Should I be able to upgrade to latest dev without incident?

 
 

Drupal is a registered trademark of Dries Buytaert.