Note: The workaround described here is no longer neccessary since tribune 6.x-1.13. Tribune 6.x-1.13 has a builtin update of the chat-users-block, so block-refresh is no longer needed to realize it.


I had some problems running Drupal 6.14 with the modules "Tribune" and "Block Refresh" together in one page.

Got Tribune (6.x-1.x-dev) from here: drupal.org/project/tribune, and Block-Refresh from here: drupal.org/node/217866/release.

I used Tribune to add a Chat to a site and tried to update the "Tribune Users" block regularily with the Block-Refresh module. The Tribune part worked as expected - but the users-block did not update. So there must be a problem with Block-Refresh.

First Problem, Block-Refresh:

The Block-Refresh javascript code reloads the block content from a url in the form:

[base]/block_refresh/...

but there is nothing (404 page) , the correct url should have the form:

[base]/?q=block_refresh/...

After hacking the code in theme_block_refresh_js() and theme_block_manual_refresh_js() of block_refresh.module to include "?q=" in the url the module was working as expected.

Here is the url-patch.

Maybe drupal.org/node/255745#comment-2137396 is related to this problem.

Ah, his post has the answer: drupal.org/node/255745#comment-2265586, you have to use drupals "clean url's" to use this module! Since i do not want to enable "clean url's" i will use my patched version of Block-Refresh ...

After running my newly created chat for a while i realized another problem: The chat browser window freezed and used all cpu time. So we have the

Second Problem, Tribune (and Block Refresh):

This problem arises only if Tribune is used in conjunction with a module that includes javascript that uses a Drupal.attachBehaviors() call. Block-Refresh is such a module.

The javascript Refresh method block_refresh() (and block_refresh_manual()) call Drupal.attachBehaviors() which in turn calls the Tribune init method Drupal.behaviors.tribune. This init method starts a javasript timer with setInterval() and thats the major drawback. It means that every time block_refresh() is updating its block a new javascript timer is started in the Tribune init method!

We end with a forever growing list of timers and continous page-updates which in turn freezes our browser.

I have made three changes to avoid this behavior:

  1. Tribune: check context in Drupal.behaviors.tribune
  2. Tribune: clear running timers in Drupal.behaviors.tribune
  3. Block-Refresh: use Drupal.attachBehaviors() with a context parameter in block_refresh() (and block_refresh_manual())

Second Block-Refresh patch.

Tribune Behaviors() patch.