I was trying to use a customized user_relationships-pending_block.tpl.php instead of the default one provided by the module user_relationship_blocks.
My changes were minimal, replacing (last line of the document):

print $output ? implode('', $output) : t('No Pending Requests');

by

print $output ? implode('', $output) : '';

in order to hide the block whenever there is no information to display (since content is empty, block is not displayed).

So I put the customized template in my theme directory, clear the theme cache and I was happy to see that my change was taken into consideration. But I noticed something weird, the block would not be updated immediately whenever changes were made to my "pending" relationships. To get the block updated, I had to clear the theme cache every time (which is problematic).

I am not certain where the issue is. If using the original template, the behaviour is correct and the block get updated as soon as I request or cancel a relationship (expected behaviour that match the code of the module: the cache is properly set to BLOCK_NO_CACHE). I have not tested with the other block template, but I suspect they will exhibit the same behaviour.

The issue is not related to my theme (I tested the issue with the Garland theme and the same problem occurs). I have resorted to modify (for the time being) the template provided by the module.

Comments

alex.k’s picture

Assigned: Unassigned » alex.k

Strange, will try to reproduce. Could you check that caching is indeed off for this block in the blocks table? There was an issue with stuck blocks not long ago, but as you mention it's been corrected. Not sure if hook_update did its job for you.
Also, on a side note, if you're using String Overrides, it can rewrite the string to an empty one without theming changes.

spouilly’s picture

Hi there,

On the drupal performance settings, the cache mechanism is "disabled" and all optimization mechanism (block caching, css and js optimization) are disable as well.

Checking the block table in MySQL, I can see that the cache value for all blocks related to the module "user_relationships" is "-1" (which I assume means disabled).

Sylvain

ps: Thanks for the tips on "String Override", I didn't know that such module exist ... I will look into it

alex.k’s picture

Issue tags: +rc3block

.

alex.k’s picture

Status: Active » Fixed

Committed a fix in http://drupal.org/cvs?commit=279790. update.php must be run. We had the same problem earlier in UR-UI module with page templates getting stuck #361657: Copying user_template.tpl.php into theme folder, breaks user_relationships module. . The same solution was used - moving preprocess functions from templates/user_relationship_blocks.template.inc to the .module file.

Status: Fixed » Closed (fixed)
Issue tags: -rc3block

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