I have a panel variant, with panes set to be cached using rules-based caching, but when I try to set up the rule, the list of panel panes to select is empty. I have installed the latest rules, and cache actions DEV's, but still not working. I have another site with a similar setup, and it's working fine. I tried to duplicate the settings on the one that's not, but it's still not working. I know it must be something simple, but I've checked everything I can find without any luck.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wxman’s picture

Is this question in the wrong module? I've tried to duplicate on the non working site, exactly what the working site has, and it still shows nothing in the Panel Panes list when setting the rule.

fabsor’s picture

Status: Active » Postponed (maintainer needs more info)

Hi!

Sorry for not getting back sooner. I have a hard time reproducing this, so I need some more info about your current setup:

* Is your panel in code or in the database?
* What kind of panels panes aren't showing up? Views panes? Blocks? ...
* If it's possible, I would like to have a look at the exported panel output, so that I can examine it and try to determine what the problem is. To export a panel, go to /admin/build/pages, click "edit", and then the export tab.

If you provide this information, I might be able to help you further. Thank you for reporting this!

wxman’s picture

FileSize
7.06 KB

Hi

* Is your panel in code or in the database?
Storage: Normal.

* What kind of panels panes aren't showing up? Views panes? Blocks? ...
View panes mostly, but it did the same when I tried it on a block.

* If it's possible, I would like to have a look at the exported panel output, so that I can examine it and try to
determine what the problem is. To export a panel, go to /admin/build/pages, click "edit", and then the export tab.
I'm attaching the copy.

I am able to use rule to clear the cache if I set it for the whole variant, and use simple cache. I would much rather use the separate panels if I can. This is happening on other similar pages as well, but I'm just including the home page for now.
Thanks for the help.

wxman’s picture

Did you need more information than I gave?

wxman’s picture

Is there anyone around?

wxman’s picture

I have uninstalled/reinstalled the module, and then I set a blog display pane to rules caching. Once again I get no list of panes when I tried to set up a rule for it. I was able to save the rule anyway even though I didn't set a specific pane. I get this when I added a test blog entry:

0 ms "Content is going to be saved" has been invoked.
0.064 ms Executing the rule "Clear blog cache" on rule set "Content is going to be saved"
0.161 ms Condition "Created content is Blog entry" evaluated to TRUE.
0.243 ms Action execution: "Clear the cache for panel page panes"
8.571 ms Executing the rule "Clear news cache" on rule set "Content is going to be saved"
8.651 ms Condition "Content is News" evaluated to FALSE.

At 0.243 ms it is triggering the rule, so the problem seems to only be generating the list of panes.

After that test, I manually added the "Cache Actions Test Panel Pane" that came with the module by importing that page's code. I went back to the rules and checked, and the new test page showed, and it had a panel pane listed. The problem is, the pane listed was not the right one. In fact, the pane it showed is on a different panel page, and isn't even set to be cached. I've dug around in the code, and I found where it's looking for the panes, but I still can't track down what's going wrong. I really could use some help. I don't want to be forced to do whole panel page caching if I can avoid it.

fabsor’s picture

I tried to locate the problem as well, but I can't reproduce the bugs you are getting. Are you using the latest version of Panels and CTools?

I will try and dive in even deeper during next week.

wxman’s picture

Yes I am using the latest. If there is anything else I can try to help you, just let me know. Thanks.

fabsor’s picture

I have some javascript that puts the right panes in when you change the panel variant you want to cache on. Could you try and disable javascript and see if anything shows up?

wxman’s picture

FileSize
42.93 KB

I used FireFox, disabled JS in the options, reloaded my home page and saved it with rules caching on two of the panel panes. When I went to the rules and tried to add a new action, it still showed the same as what I said in #6. I've attached a JPG of the screen. I had already removed the test panel page that I used to generate the test before, but the pane is still showing. I even cleared out all the caches just to be sure. The news pane from the home page I wanted to show on the list was still not there. I tried selecting all the different panel pages that have pane caches, but the list never changed. Sorry.

wxman’s picture

Just to see what would happen, I uninstalled the Page manager, and cache actions. I reinstalled them, and imported all the pages back. It's still doing the same thing.

wxman’s picture

Is there anything else you need? If there was a way to start from scratch without loosing the site I would try it. A couple of other sites I do are using the same system, and it works on them. I have tried to compare the site to find a difference, but I didn't have any luck.

EDIT:
I tried a couple of other experiments. I set a new copy of the theme, then I switched to Garland and tried that. No luck with either of them. I Just started a new site using the same sort of setup, tested a panel page there, and it does work. Whatever the cause, it's only on the one site, and it has to be something that just got corrupted at some point because it was working fine after I first installed the module.

fabsor’s picture

This is really a hard nut to crack. I have tried to reproduce this problem couple of times now, and I have failed miserably =/

As it stands right now, I'm getting nowhere with this issue. This problem must be very specific to your site, and in some way we are triggering some weird edge case here.

I really appreciate your thoroughness in your bug reports. Keep them coming and I will try to help to the best of my abilities.

wxman’s picture

You said the JS does the actual populating of the form field.
Is the needed function in cache_actions.js?
Are there also functions elsewhere that handle the look up?
What is it looking for in the database that tells it to add a pane to the list?

I'm wondering if the DB entry might have a problem. I've compared entries with a working site, and I didn't see anything obvious that was different. I'm just trying to think of the easiest reasons it wouldn't populate the field. Not finding the proper entry in the DB was my first thought.

wxman’s picture

I just did a test using mini panels, and it works for them even thought it's still not not working for regular panel panes.
Could this be, like I asked before, something missing from the database entries? I looked through the db content but I couldn't find anything that it could be using.

achton’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
584 bytes

I'm pretty sure this patch fixes the problem.

Looking at the way panels_panel_context_get_display loads Panels displays, I think the wrong did value was being used in the context handler. I also think this explains why the wrong panes were being loaded in wxman's description in #6.

So take it for a spin :) Although I should point out that I by no means fully grok the Panels data structure.

wxman’s picture

You're the best! It really seems to be working now. I'll take it for a real run in a couple of days.

achton’s picture

Category: support » bug

That's good, let me know how it goes.

I can't help wonder how it hasn't bothered anybody before though. I think the bug may not show up in tests, because the two did values in the handler object might be the same (e.g. 1), but on complex sites with multiple panel pages, displays and panes, the problem becomes apparent.

Also, I'm changing this to a bug report.

fabsor’s picture

This is awesome! Panels and CTools is a big beast, so it's hard to tell why it is working, but if I can get a confirm on this and if the tests run fine, I will go ahead and commit this for sure.

wxman’s picture

I've tried it on several pages, and it seems to be working. I really don't have a good way to test if it's actually cacking content properly, but it seems to be. The only problem remaining I have with this has nothing to do with cache actions, at least I don't think it does. It's a cache VS pager problem I posted at http://drupal.org/node/1311506#comment-5204336. Not a big deal though. Thanks again for the help.

das-peter’s picture

Just came across the same issue.
Approach patch #16 solved that - even in the 7.x branch.
I'm not sure how it comes to those different dids yet, but for now it seems to fix the issue.
Maybe we should mark this issue as postpone after the patch is committed - would be good to do some further investigation to find the root cause of the problem.

das-peter’s picture

Status: Needs review » Reviewed & tested by the community

Oh, I'd say RTBC ;)

fabsor’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Alright, I pushed the fix to 6.x

fabsor’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Changing version.

fabsor’s picture

Title: Caching Panel Variants shows no Panel Panes » Look into why we are have to use handler->conf['did'] instead of using handler->did directly.
Category: bug » task
Priority: Normal » Minor
Status: Patch (to be ported) » Postponed

I pushed this fix to 7.x as well. I'm setting this to postponed, since it might be interesting to find the root cause as das-peter suggests.