Block refresh doesn't work inside a panels 2 page

MarcoR - January 23, 2009 - 21:17
Project:Block Refresh
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:blocks, block_refresh, jQuery, panels, Panels2
Description

I created a block from the "add block" tab, put in some working php-code (checking inbox for a private messages). I put it into a panel and the block's content hasn't been updated. I also put it aside the page into a usual sidebar. The block in the sidebar has been updated, the block inside the panel is not.

#1

corona ronin - February 10, 2009 - 21:26

I have a similar issue, in that it will not refresh in panels. I also have it in the sidebar, and it will not refresh in the sidebar either. Would you like me to make a seperate support request or try to consolidate with this one?

Thanks.

#2

MarcoR - March 3, 2009 - 22:21

Same issue here. As you can see in the code, it's kind of a matter of design. And thats a pity, because panel pages often serve as overviews of latest content. If used instead of the many blocks aside pages, these panel-pages help to scale traffic down on large sites. Reason enough to provide some way for block_refresh to work with panels.

Here is the code that might be responsible:

<?php
/**
*  implements hook_footer
*  calls the jquery to refresh blocks automatically, but only if the blocks exist on the current page and are enabled
*/
function block_refresh_footer() {
 
// don't bother to continue if the user can't refresh content anyway...
 
if (!user_access('access block refresh content')) {
    return;
  }
  global
$theme_key;
 
$blocks = array();
 
$regions = system_region_list($theme_key);
  foreach (
$regions as $region => $value) {
   
$blocks = array_merge($blocks, block_list($region));
  }
...
?>

So just the blocks that are tied to regions are affected. I suppose panels define no page-regions. Someone who knows better about the region-design of panels2 might want to help out here.

#3

dunkelfuerst - March 4, 2009 - 12:37

This solution should solve your problem too:
http://drupal.org/node/221676#comment-1062976

If your ar using drupal 6, there's a working 6.x-version on my homepage. It should work within panels, too:
http://dunkelfuerst.com/projekte/drupal-block-refresh-6x

#4

pribeh - April 23, 2009 - 22:30

Same problem here. I've applied the code change suggested in comment #17 from the block_refresh issue cue but to no avail. Blocks within a panel do not work. I believe Marco is up to something.

#5

pribeh - April 23, 2009 - 23:30

Here's a link to my site's first user http://lc3.figureandground.net/user/2

I'll leave the site open tonight with access privileges turned on for anonymous. The left sidebar has a block displaying an activity block that has refresh working and the panel to the right has an activity block with it not working. They might be different blocks at the time of your viewing but I assure you that none of them work within the panel.

Any help would be greatly appreciated. I really want to get this to work.

 
 

Drupal is a registered trademark of Dries Buytaert.