A defined and assigned Random block will not be updated when its update interval has expired. The SQL query to determine if a Random block exists is wrong.
In the {block} table the Web Links Blocks module is stored as 'weblinks_blocks' and not 'weblinks'. So this code has stopped working for a while since the separate sections were moved out into contribs instead of being all in weblinks.module.
<?php
$block_exists = db_result(db_query("SELECT COUNT(*) FROM {block} b WHERE b.theme='%s' AND b.module='weblinks' AND b.delta='weblink-random' AND b.status=1", $theme));
?>
The code in D6 is wrong too. Patch will follow.
Comments
Comment #1
gstegemann commentedComment #2
gstegemann commentedComment #3
gstegemann commentedComment #4
gstegemann commentedHere's the patch against 7.x-1.x-dev.
Comment #6
jonathan1055 commentedHi Gerhard,
Sorry for confusing you, the table is {blocks} in D6 but {block} in D7.
Not sure what happened with the test. The failure in the log is:
This does not seem to be anything to do with your patch.
Comment #7
gstegemann commentedHi Jonathan,
no, you didn't confuse me. I already noticed the difference in the "Block" table names and corrected the issue description accordingly.
Regarding the test: yes, that looks like testbot system problem. Are you going to reschedule the test?
Comment #8
jonathan1055 commentedThe testbot error has been reported #2375345: Dependency on core module results in PHP Fatal error: Cannot redeclare system_requirements(). We will wait for that to clear before re-queueing the test.
Comment #9
jonathan1055 commentedRequeueing as the automated testing problem seems to be resolved now.
Comment #11
jonathan1055 commentedTested manually and this is good and RTBC.
My random links were actually being changed if I did a page refresh in between cron runs, as I had set the interval for 2 minutes but my cron was every 10 mins. I guess something else was doing a cache_clear_all() so that all block content was cleared.
Comment #12
gstegemann commentedThanks for testing.
I will commit the patch and prepare one for the D6 version.
Yes, that may happened that way. I also tested page refreshes and the random block content was not updated every page refresh.
Comment #13
gstegemann commentedComment #15
jonathan1055 commentedGood work. Yes, port to D6 now.
Comment #16
gstegemann commentedD6 patch has landed.
Comment #18
jonathan1055 commentedPatch was perfect. Tested and committed.
I also fixed one php5 warning in the same file:
This had already been corrected in D7, so I used the identical fix for D6.
Comment #19
gstegemann commentedThanks. Also for applying the 'weblinks_blocks_sort' fix.
Comment #22
jonathan1055 commentedThe issue is fixed. Patch from #16 got requeued, and obviously it fails to apply because the code change is already committed in #17.