Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have tried the module with a block in standard Drupal caching.
Works fine in automatic and manual refresh mode. But only on page load mode - fails.
The block contains a php generated image, so I am looking for a way to refresh it on each page load not disabling caching.
Comment | File | Size | Author |
---|---|---|---|
#15 | block_refresh_init_404-2280127-13.patch | 721 bytes | tripper54 |
#12 | screen-4 Manual change.png | 59.96 KB | flamez-b |
#11 | screen-3 Auto change.png | 73.52 KB | flamez-b |
#8 | screen-2.png | 45.19 KB | flamez-b |
Comments
Comment #1
tripper54 CreditAttribution: tripper54 commentedHI flamez-b,
Some questions:
1. Define 'fails'. Does the block not refresh, refresh but load the same content, or do you get an error? Or something else?
2. Do you have page caching enabled? If so, what happens when you disable page caching? Does the block refresh behaviour change? If so, how?
Thanks!
Comment #2
flamez-b CreditAttribution: flamez-b commentedThank you for a quick reply.
On page reload the block loads the same content, no refreshing, no errors occur.
Disabling caching the behavior gets as aspected - images change each time on reload.
I have also tried the demo block from the module set, but with the same result.
Comment #3
tripper54 CreditAttribution: tripper54 commentedHave you tried using the "bypass drupal page cache" option in the block refresh settings for the block?
Also, have you tried setting the "external cache max age" to 0 ?
Comment #4
flamez-b CreditAttribution: flamez-b commentedEnable block to be refreshed on page load - on
Send page path arguments to block - on (doesn't effect)
Bypass Drupal page cache - on (automatic change doesnt work if "off", so it is allways "on")
External cache max age - 0 (doesn't effect, tried 0,1,10)
others - off
Comment #5
flamez-b CreditAttribution: flamez-b commentedI am sorry, I have not noticed initially - there is a mistake on reload, screen attached...
Comment #6
flamez-b CreditAttribution: flamez-b commentedComment #7
tripper54 CreditAttribution: tripper54 commentedhmm, that's strange. You say auto and manual refreshes work OK?
Can you show me the request in the console for these refreshes?
Comment #8
flamez-b CreditAttribution: flamez-b commentedYes, other types of refreshes work normally... screen attached
Comment #9
tripper54 CreditAttribution: tripper54 commentedThat screen shot shows another 404. What happens when you press the manual refresh link? Does another GET request appear in your console (hopefully one that returns 200)?
Comment #10
flamez-b CreditAttribution: flamez-b commentedJust a moment...
Comment #11
flamez-b CreditAttribution: flamez-b commentedAttaching screen with autochange...
Comment #12
flamez-b CreditAttribution: flamez-b commented...and the screen with manual reload (3 reloads made).
Comment #13
flamez-b CreditAttribution: flamez-b commentedHave just bypassed all my alterations in .htaccess and dissaled all non-core modules - the bug remains.
Comment #14
flamez-b CreditAttribution: flamez-b commented...plus cleared template.php and unplugged all other js-files - the bug remains.
Comment #15
tripper54 CreditAttribution: tripper54 commentedAh. There's a bug in the block generation callback where it first checks if the block is enabled before calling the block.
Try the attached patch.
Comment #16
flamez-b CreditAttribution: flamez-b commentedNow Works!!!
Thank you so much!
So I may keep now on the futher testing.
Comment #17
flamez-b CreditAttribution: flamez-b commentedComment #18
tripper54 CreditAttribution: tripper54 commentedI'll leave this issue as RTBC until I commit the patch. Thanks for your help in finding this.
Comment #19
flamez-b CreditAttribution: flamez-b commentedOh, I am sorry for closing the issue... yet don't now all the drupal.org rules...
About the module, there's a little feature request - I'll write about in another thread.
Thank you, tripper54.
Comment #20
flamez-b CreditAttribution: flamez-b commentedI have noticed an interesting moment handling page reloads:
As I said I use the module to shuffle images on each reload, so when reloading a page it comes some fast blinking of an image that was initially cached with the whole page, i.e. assume that we have two layers – the upper one is a layer that changes on reload, and the lower is the one laying constantly on the same place like a pad and getting visible each time we change the upper layer. These several millisecond during refreshing produces such blinking.
I guess the only thing that could be done to mimic this effect is to disable expire time in .htaccess with the type of images shuffling in this block, but I am afraid this could be a tricky one so that not to affect all other images. Or maybe there are some ways?
Comment #21
flamez-b CreditAttribution: flamez-b commentedWell, supposed to be this effect is not because of the cached pages - I dissabled all caching but the blinks go on. Really strange, I have to think that this goes from somewhere inside the module.
Comment #22
tripper54 CreditAttribution: tripper54 commentedHi flamez-b,
Could you move your observations to a new issue? This issue has addressed your original bug report. It's best to keep these things as granular as possible so we can keep track of what's been fixed and what hasn't.
thanks
Comment #23
tripper54 CreditAttribution: tripper54 commentedCommitted to 7.x-2.x-dev