this does not work with the sky theme, it does not refresh the blog at all.

regards dave

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bocaj’s picture

Title: Hi » Block Refresh not working with Sky Theme

Changed title to be more descriptive

Hi Dave,
I have confirmed your issue. It appears to be an issue with block.tpl.php, which can be found in [sky_root_directory]/templates/overrides by default. I changed out the entire content of that file with the content of the same file from the aquia_marina theme. After doing this Block Refresh worked as expected.

However, this change did change the styling of the blocks in the Sky theme, beware of that. I will look into this some more and see if I can find out exactly what in the Sky's block.tpl.php file is causing the issue. This will hopefully be a workaround for now though.

Thanks for using (or attempting to use) the module!

bocaj’s picture

Status: Active » Closed (won't fix)

I have searched this issue further and have narrowed it down to the id that is set for the block. Most themes declare the id for a block in the following format:

block-views-trail_blocks-block_2

The Sky theme declares the id like so:

block-views-trail-blocks-block-2

Notice the - instead of _ after 'trail' and after 'block'. That is the issue that is causing Block Refresh not to work with the Sky theme.

After doing some quick testing it appears that if you change line 12 in block.tpl.php of the Sky theme to:

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" <?php print $block_attributes; ?>>

it appears like that enables Block Refresh to work properly. Overriding the block template and keeping the default block.tpl.php in place would be the best practice so that any updates to the Sky theme doesn't overwrite any changes.

Hope this helps! Marking as won't fix as all (10) other themes I tested used the expected block id format.

Please reopen this issue if there are other themes that appear to have this same issue.

Ankit Srivastava’s picture

Title: Block Refresh not working with Sky Theme » Block Refresh not working with drupal_theme_63
Version: 6.x-1.x-dev » 6.x-1.0-alpha2
Priority: Normal » Major
Status: Closed (won't fix) » Active

Hi,

I am using the theme drupal_theme_63 and i have a block residing in the banner 3 region which i need to refresh every 30 seconds or so.. but im not able to get this to work. I tried the above fix but it didnt seem to refresh the block still.

I also went through the issue queue and tried checking the "$_SERVER['REQUEST_URI'] path and it is also not getting changed which means the block is not refreshing at all.

Could you please have a look at this if possible as i would totally appreciate it..
Thanks in advance.

bocaj’s picture

Hi Ankit,
I am unable to find any reference to drupal_theme_63 anywhere. Could you send me a link to the web page that has Block Refresh currently enabled, but not working? You can send me a private contact message here.

I would be happy to look into this more for you!

Ankit Srivastava’s picture

Status: Active » Closed (works as designed)

Hi,

Thanks for the awesomely quick response in solving this for me...Its fixed now and working like a charm.
I love the Drupal community...

Ankit

bocaj’s picture

@Ankit I am glad to hear that you were able to fix this issue and that it is running properly now.

For the Community: The issue was again the id in the div tag for the block. I will provide better documentation for this in future releases of Block Refresh as this has cropped up many times. Also, there was an issue with an unrelated javascript function that was not functioning properly.

Also, thanks to everyone who makes Drupal the awesome community that it is!!

I love the Drupal community... ~Ankit

This is how we make the community grow and become even better...one person at a time!

bocaj’s picture

Title: Block Refresh not working with drupal_theme_63 » Block Refresh doesn't work with some themes (SOLUTION)

Changing the title of this issue since there are multiple themes that are not constructed the way that Block Refresh is expecting. Please post any issues related to those above in this queue!

eclauset’s picture

not sure if this is theme-related, but I have a block that is not refreshing in Firefox. It seems to work fine in Safari, and I haven't had a chance to test other browsers.

http://www.wxyc.org/

the block is the one with live playlists in the upper right, "Now Playing"

bocaj’s picture

@eclauset It does appear the the block is not refreshing in Firefox 3.6.10 or IE8. I'm not sure exactly how your content in the block is being built, but I see through Firebug that Block Refresh is firing appropriately (as well as recent.html). It appears that at this point the module is working properly. Possibly a missing HTML tag or something somewhere?

I would make a separate, simple block with like a random number generator from php or something and see if that works. If so, then the issue has to be within the "Now Playing" block somewhere.

Let me know if I can help you any more!

pilotget’s picture

I am experiencing the same problem. Block refresh works on Safari, but not on IE or FF. How was this problem ultimately solved?

UPDATE: I found the problem. I had not granted "access block refresh content" to anonymous users. Since I was logged in on Safari, it worked, but it would not refresh on IE and FF, where I was not logged in... Pretty dumb on my part, but I'm confessing to my blunder in the hopes that it can help someone else.

stplanken’s picture

It wasn't working for me either even though Firebug proved that the refresh itself appeared to be working. I found the problem: I am using a theme that is (1) not using a block ID at all and (2) uses a class of "blockcontent" for the block's content, instead of the standard "content".

As soon as I added the block ID as described earlier here and added the "content" class (even though I am not using it anywhere) the auto refresh started working. (Of course, the permission needs to be set as well.)

Hopefully it will help someone.

jurgenhaas’s picture

I ran into the same problem here. I think D7 is using the class "block-content" instead of "content" by default and I would suggest to use the block-content class for the JQuery selector in this module instead. I'm sure it would avoid some headaches out there.

jide’s picture

deme18’s picture

Version: 6.x-1.0-alpha2 » 7.x-2.x-dev
Priority: Major » Normal
Status: Closed (works as designed) » Active

Has anyone gotten this to work with the Pixture Reloaded theme, I have followed post #2 and even tried using the Block Theme module to change witch theme the block uses with no results. Any help would be appreciated.

ipsec’s picture

Same problem with AT Commerce 7.x-2.0-rc2 theme.

After block refresh I got a empty block.

alexpsfti’s picture

Doesn't work with AT Core + Pixture Reloaded theme. Any help would be greatly appreciated.

sol0matrix80’s picture

Please can anyone write a step by step on how to get this to work with themes for none devs i am a designer and i would love to use this module for sites i am making

sol0matrix80’s picture

System info: drupal 7.21 theme precision 7.1x dev block refresh 7.2x dev with panels

jhelou’s picture

I am using "Corporate Clean" theme and i verified that the block id is set with "-" instead of "_" . but when i ran a grep to find out where the block id was being assigned it came back as being in Drupal core module "Dashboard". totally independent from the theme...
Also the line

print $block->module .'-'. $block->delta; " print $block_attributes; > is not changing "-" to "_" is this a typo?

thank you for your help

UPDATE: i figured out that the problem is a conflict between modal forms and refresh block. i am posting this as a new issue.

NewZeal’s picture

Status: Active » Patch (to be ported)
FileSize
3.05 KB

This problem is caused by the way in which drupal by default displays the block id. In block.module in the function template_preprocess_block() the block name is processed via a function called drupal_html_id() which converts underscores into dashes. This id is then outputted in the block.tpl as the variable $block_html_id. For maximum compatibility between the block_refresh module and themes, the same function should be used in the block_refresh module.

There is a patch attached which fixes this incompatibility.

linksync’s picture

Hi New Zeal,

What version is your patch for? When I run the patch it fails on all but two of the updates.

Are you able to supply the patched working block_refresh.module file?

Thanks.

jhelou’s picture

7.x

Anybody’s picture

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

The patch works great and fixes the problems. I've attached a new version agains the LATEST 2.x DEV!
Please apply it to the latest .dev asap =)

Thanks a lot for this great module!

tripper54’s picture

Assigned: Unassigned » tripper54
Issue summary: View changes
tripper54’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7x.-2.x , thanks!

tripper54’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

Needs backport to 7.x-1.x

tripper54’s picture

Status: Patch (to be ported) » Needs review
FileSize
5.19 KB
tripper54’s picture

Status: Needs review » Fixed

Committed to 7x.-1.x

tripper54’s picture

Assigned: tripper54 » Unassigned

Status: Fixed » Closed (fixed)

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