Panel panes are natural contenders for serving via Edge Side Includes.

The attached patch is a first-pass at adding panels support to the Esi module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Donaldd’s picture

Thanks manarth for your patch and you slides!

Your slides really helped me get a better understanding of how esi works.

But I have a problem with your patch.
When I patch the module and I add esi as the panel cache. Then panels returns the ESI panes as empty.

What could be the reason of this, am I doing something wrong?

Thanks,
D

Cyberwolf’s picture

Subscribing.

mikeytown2’s picture

Version: 6.x-1.0-beta1 » 6.x-2.x-dev
Status: Needs review » Fixed

This has been fixed in the 2.x branch. If I am mistaken please re-open.

Status: Fixed » Closed (fixed)

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

cmlara’s picture

Status: Closed (fixed) » Needs work
FileSize
814 bytes

Hello,

The initial patch has a few issues. Per DonaldD's comment 1 I was able to duplicate and track down

The biggest issue is “$task_menu_callback” should be “$task_name” on line 669 of esi.module without this the content doesn't render at all when using a panel with areas inside of it. This part is 'critical' against -DEV for the feature to work.

  function esi__panels_get_task_context($task_name) {
  $task = page_manager_get_task($task_name);

Also versus the original patch for function esi__panel_pane_handler and the active patch I think both have it wrong

function esi__panel_pane_handler($bid, $page = NULL, $task_name = NULL, $context_string = NULL) 

Original Patch:

  $items['esi/panels_pane/%'] = array(
    'title' => 'ESI handler',
    'page callback' => 'esi__panel_pane_handler',
    'page arguments' => array(2,3),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK

Active in -DEV :

  $items['esi/panels_pane/%'] = array(
    'title' => 'ESI handler',
    'page callback' => 'esi__panel_pane_handler',
    'page arguments' => array(2),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK

I think this really should be

  $items['esi/panels_pane/%'] = array(
    'title' => 'ESI handler',
    'page callback' => 'esi__panel_pane_handler',
    'page arguments' => array(2,3,4,5),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK

in order to match the function. This is less critical compared to the first part but I did it in my patch because it seems correct to the code and the esi tags creation.

I think it should be noted there are still other bugs with this patch that I haven't yet debugged but this makes the module work at a basic level

Really good module with this feature in it will help meet my project needs. The panel support is key to my goal of having most the reusable content be services from the frontend Varnish and only feed change data (like comments) from the backend. I just wish 7.x had the feature set of this module

Patch against -DEV attached

mikeytown2’s picture

Status: Needs work » Fixed

Committed #5. Re-open issue if you have more code changes; or open a new issue.

Status: Fixed » Closed (fixed)

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